Skip to content

Commit ab0b57e

Browse files
author
Xander Dumaine
committed
Some more fixes for error message formatting, add an indicator when passing a long test in sort mode
1 parent de37d40 commit ab0b57e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎index.js‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ function TimeReporter (opts) {
1717
TimeReporter.prototype = {
1818
writeFailure: function (data) {
1919
write(chalk.red(`\nTest Failure - ${data.name.trim()}\n`));
20-
if (data.error) {
21-
write(JSON.stringify(data.error.message, null, 2) + '\n');
22-
write(typeof data.error === 'string' ? data.error : JSON.stringify(data.error, null, 2));
20+
if (data.error && data.error.message) {
21+
write(chalk.red(data.error.message) + '\n');
22+
write(chalk.red(data.error.stack) + '\n');
2323
} else {
24-
write(chalk.red(`\t Test failed with no error object. ${JSON.stringify(data)}`));
24+
write(chalk.red(`${JSON.stringify(data)}`));
2525
}
2626
this.failures.push(data);
2727
},
@@ -41,6 +41,11 @@ TimeReporter.prototype = {
4141
}
4242
if (this.opts.sort && !this.done && data.runDuration > 500) {
4343
this.longTests.push(data);
44+
dot = true;
45+
if (!this.previousDot) {
46+
write('\n');
47+
}
48+
write('⌛️');
4449
return;
4550
}
4651
const result = `\n${data.runDuration}ms - ${data.name.trim()}`;

0 commit comments

Comments
 (0)