-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
test.js
36 lines (30 loc) · 671 Bytes
/
test.js
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
34
35
36
var spawn = require('cross-spawn');
var test = require('tape');
function run(mod, t) {
t.plan(1)
var ps = spawn('node', [
'-e',
'require("./")();require("' + mod + '")'
], {
stdio: [ 'ignore', 'ignore', 'pipe' ]
});
ps.on('error', t.fail.bind(t));
ps.on('close', function(code){
t.is(code, 0, 'exit code is 0')
})
ps.stderr.on('data', function(chunk) {
chunk.toString().split(/[\r\n]/).forEach(function(line){
t.comment(line)
})
})
}
var modules = [
'a-native-module',
'a-native-module-without-prebuild',
'electron-prebuilt'
];
modules.forEach(function(mod){
test(mod, function(t){
run(mod, t);
});
});