identical.js 505 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 = [ 0, 1, 0, 1 ];
  6. t.plan(expected.length + 1);
  7. var b = browserify(__dirname + '/identical/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. });