tr_global.js 502 B

1234567891011121314151617
  1. var browserify = require('../');
  2. var vm = require('vm');
  3. var test = require('tap').test;
  4. var through = require('through2');
  5. test('global transform precedence', function (t) {
  6. t.plan(1);
  7. var b = browserify(__dirname + '/tr_global/main.js', {
  8. basedir: __dirname + '/tr_global'
  9. });
  10. b.transform('tr', { global: true });
  11. b.bundle(function (err, src) {
  12. vm.runInNewContext(src, { console: { log: log } });
  13. function log (msg) { t.equal(msg, 444) }
  14. });
  15. });