Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmetcalf committed Apr 7, 2020
1 parent 8f0ad34 commit 3070f5f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/es2020.dereq.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

function outer(_dereq_, bar) {
var foo = _dereq_('foo');
var bar = 100n;
return foo(bar);
}
7 changes: 7 additions & 0 deletions test/es2020.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

function outer(require, bar) {
var foo = require('foo');
var bar = 100n;
return foo(bar);
}
9 changes: 9 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,15 @@ describe('derequire', function(){
});
});

it('should work with es2020', function(done) {
fs.readFile('./test/es2020.js', 'utf8', function(err, source) {
fs.readFile('./test/es2020.dereq.js', 'utf8', function(err, expected) {
assert.equal( derequire(source), expected);
done();
});
});
});

it('should work on multiple things', function(done) {
fs.readFile('./test/define.js', 'utf8', function(err, source) {
fs.readFile('./test/define.dereq.js', 'utf8', function(err, expected) {
Expand Down

0 comments on commit 3070f5f

Please sign in to comment.