forked from jamesshore/lets_code_javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathempty.js
More file actions
33 lines (27 loc) · 682 Bytes
/
empty.js
File metadata and controls
33 lines (27 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var test = require('tap').test;
var pack = require('../');
var vm = require('vm');
test('empty', function (t) {
t.plan(1);
var p = pack();
var src = '';
p.on('data', function (buf) { src += buf });
p.on('end', function () {
t.doesNotThrow(function() {
vm.runInNewContext(src, {});
});
});
p.end();
});
test('empty with standalone', function (t) {
t.plan(1);
var p = pack({standalone: 'ABC'});
var src = '';
p.on('data', function (buf) { src += buf });
p.on('end', function () {
t.doesNotThrow(function() {
vm.runInNewContext(src, {});
});
});
p.end();
});