noparse.js 843 B

12345678910111213141516171819202122232425262728293031
  1. var browserify = require('../');
  2. var test = require('tap').test;
  3. var path = require('path');
  4. test('noParse array', function (t) {
  5. process.chdir(__dirname);
  6. t.plan(2);
  7. var actual = [];
  8. var expected = [
  9. 'noparse/a.js',
  10. 'noparse/b.js',
  11. 'noparse/dir1/1.js',
  12. 'noparse/node_modules/robot/main.js'
  13. ].map(function (x) {return path.resolve(x);}).sort();
  14. var b = browserify({
  15. entries: [ __dirname + '/noparse/a.js' ],
  16. noParse: [
  17. path.join(__dirname, 'noparse/dir1/1.js'),
  18. path.join(__dirname, 'noparse/node_modules/robot/main.js')
  19. ]
  20. });
  21. b.on('dep', function(dep) { actual.push(dep.file); });
  22. b.bundle(function (err, src) {
  23. actual.sort();
  24. t.ifError(err);
  25. t.deepEqual(actual, expected);
  26. });
  27. });