Commit 05f12e92 authored by Maciej Małecki's avatar Maciej Małecki Committed by Cédric de Saint Martin

[minor] Nicer output from test runner

parent b053198c
......@@ -45,8 +45,9 @@ function runTest(test, callback) {
child.on('exit', function (exitCode) {
clearTimeout(killTimeout);
console.log(' ' + ((exitCode) ? ''.red : ''.green) + ' ' +
path.basename(test) + (exitCode && ' (exit code: ' + exitCode + ')'));
console.log(' ' + ((exitCode) ? ''.red : ''.green) + ' ' +
path.basename(test) +
(exitCode ? (' (exit code: ' + exitCode + ')') : ''));
results[test] = { exitCode: exitCode };
callback();
//
......@@ -68,13 +69,14 @@ if (!tests.length) {
//
}
console.log('Running tests:'.bold);
async.forEachSeries(tests, runTest, function () {
var failed = [], ok = [];
for (var test in results) {
(results[test].exitCode != 0 ? failed : ok).push(test);
}
console.log('\nSummary:');
console.log('\nSummary:'.bold);
console.log((' ' + ok.length + '\tpassed tests').green);
console.log((' ' + failed.length + '\tfailed tests').red);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment