Skip to content

Commit

Permalink
Added regression test for noParse option with relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ZolotovDY authored and ZolotovDY committed Aug 26, 2024
1 parent dac674a commit 27d7564
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/noparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,31 @@ test('noParse array', function (t) {
t.deepEqual(actual, expected);
});
});

test('noParse array with relative paths', function (t) {
process.chdir(__dirname);

t.plan(2);

var actual = [];
var expected = [
'noparse/a.js',
'noparse/b.js',
'noparse/dir1/1.js',
'noparse/node_modules/robot/main.js'
].map(function (x) {return path.resolve(x);}).sort();

var b = browserify({
entries: [ __dirname + '/noparse/a.js' ],
noParse: [
path.join('noparse/dir1/1.js'),
path.join('noparse/node_modules/robot/main.js')
]
});
b.on('dep', function(dep) { actual.push(dep.file); });
b.bundle(function (err, src) {
actual.sort();
t.ifError(err);
t.deepEqual(actual, expected);
});
});

0 comments on commit 27d7564

Please sign in to comment.