|
|
@ -133,8 +133,7 @@ function sum(arr, key) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
function exit(testRun) { |
|
|
|
var results = testRun.results; |
|
|
|
function exit(results) { |
|
|
|
// assemble stats from all tests
|
|
|
|
var stats = results.map(function (result) { |
|
|
|
return result.stats; |
|
|
@ -159,10 +158,7 @@ function exit(testRun) { |
|
|
|
// correctly flush the output when multiple test files
|
|
|
|
process.stdout.write(''); |
|
|
|
|
|
|
|
// wait for the child processes to exit
|
|
|
|
testRun.childProcesses.finally(function () { |
|
|
|
process.exit(failed > 0 ? 1 : 0); |
|
|
|
}); |
|
|
|
process.exit(failed > 0 ? 1 : 0); |
|
|
|
} |
|
|
|
|
|
|
|
function init(files) { |
|
|
@ -182,14 +178,7 @@ function init(files) { |
|
|
|
|
|
|
|
var tests = files.map(run); |
|
|
|
|
|
|
|
return Promise.all(tests).then(function (results) { |
|
|
|
return { |
|
|
|
results: results, |
|
|
|
childProcesses: Promise.map(tests, function (test) { |
|
|
|
return test.kill(); |
|
|
|
}) |
|
|
|
}; |
|
|
|
}); |
|
|
|
return Promise.all(tests); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|