identical_different.js 518 B

12345678910111213141516171819
  1. var browserify = require('../');
  2. var test = require('tap').test;
  3. var vm = require('vm');
  4. test('identical', function (t) {
  5. var expected = [ 1, 2, 10, 110 ];
  6. t.plan(expected.length + 1);
  7. var b = browserify(__dirname + '/identical_different/main.js');
  8. b.bundle(function (err, src) {
  9. t.ifError(err);
  10. vm.runInNewContext(src.toString('utf8'), {
  11. console: { log: log }
  12. });
  13. function log (msg) {
  14. t.equal(msg, expected.shift());
  15. }
  16. });
  17. });