forked from umijs/umi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
30 lines (28 loc) · 704 Bytes
/
test.js
File metadata and controls
30 lines (28 loc) · 704 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
const spawn = require('cross-spawn');
const startDevServers = require('./startDevServers');
startDevServers()
.then(devServers => {
const argv = process.argv.slice(2) || [];
const testCmd = spawn(
'npm',
['run', 'test:coverage'].concat(
// argv pass down into jest
argv.length > 0 ? ['--', ...argv] : [],
),
{
stdio: 'inherit',
},
);
testCmd.on('exit', code => {
devServers.forEach(devServer => {
if (devServer) {
devServer.kill('SIGINT');
}
});
console.log('testCmd exit', code);
process.exit(code);
});
})
.catch(e => {
console.log('startDevServer error', e);
});