process.js 547 B

123456789101112131415161718192021
  1. var browserify = require('../');
  2. var vm = require('vm');
  3. var test = require('tap').test;
  4. test('implicit process global', function (t) {
  5. t.plan(2);
  6. var b = browserify(__dirname + '/process/main.js');
  7. b.bundle(function (err, src) {
  8. var c = {
  9. done : function (one, two) {
  10. t.equal(one, 1);
  11. t.equal(two, 2);
  12. t.end();
  13. },
  14. setTimeout: setTimeout,
  15. clearTimeout: clearTimeout
  16. };
  17. vm.runInNewContext(src, c);
  18. });
  19. });