UNPKG

589 BJavaScriptView Raw
1var test = require('tap').test;
2var browserify = require('../');
3var through = require('through2');
4var vm = require('vm');
5
6test('bundle external global', function (t) {
7 t.plan(1);
8
9 var stream = through();
10 stream.push('console.log(process)');
11 stream.push(null);
12
13 var b = browserify({ bundleExternal: false });
14 b.add(stream);
15 b.bundle(function (err, src) {
16 vm.runInNewContext(src, {
17 console: { log: log },
18 process: process
19 });
20 function log (msg) {
21 t.equal(msg, process);
22 }
23 });
24});