Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80512 views
1
var test = require('tap').test;
2
var browserify = require('../');
3
var through = require('through2');
4
var vm = require('vm');
5
6
test('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(typeof msg.nextTick, 'function');
22
}
23
});
24
});
25
26