1
0
Fork 0

Handle pending mocha tests in output

This commit is contained in:
Alan Plum 2016-01-12 18:43:53 +01:00
parent f442465445
commit 812060864b
1 changed files with 14 additions and 2 deletions

View File

@ -77,6 +77,10 @@ function logStats(stats) {
+ colors.COLOR_RED
+ stats.failures
+ colors.COLOR_RESET
+ ' | '
+ colors.COLOR_CYAN
+ stats.pending
+ colors.COLOR_RESET
+ ' )'
);
}
@ -102,6 +106,14 @@ function logSuite(suite, indentLevel) {
+ test.title
+ colors.COLOR_RESET
);
} else if (test.result === 'pending') {
print(
indent(indentLevel)
+ colors.COLOR_CYAN
+ '[SKIP] '
+ test.title
+ colors.COLOR_RESET
);
} else {
print(
indent(indentLevel)
@ -155,10 +167,10 @@ function buildJson(results) {
newName = `${name} ${i++}`;
}
result[newName] = {
status: stats.result === 'pass',
status: stats.result === 'pass' || stats.result === 'pending',
duration: stats.duration
};
if (stats.result !== 'pass') {
if (stats.result !== 'pass' && stats.result !== 'pending') {
result[newName].message = stats.err.stack;
}
}