Skip to content

Commit e389ccc

Browse files
jrainvilleiurimatias
authored andcommitted
fix(@embark/reporter): show stack trace in the reporter on errors
1 parent c07ac55 commit e389ccc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/plugins/mocha-tests/src/lib/reporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Reporter {
2626
})
2727
.on(EVENT_TEST_FAIL, (test, err) => {
2828
const duration = (Date.now() - startTime) / 1000.0;
29-
this.reporter.report(test.fullTitle(), duration, false, err.message);
29+
this.reporter.report(test.fullTitle(), duration, false, err.message, err.stack);
3030
});
3131
}
3232
}

packages/stack/test-runner/src/lib/reporter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Reporter {
6060
}
6161
}
6262

63-
report(test, time, passed, message) {
63+
report(test, time, passed, message, stack) {
6464
let timeFormat = 'green';
6565
if (time > 0.7) {
6666
timeFormat = 'yellow';
@@ -76,6 +76,7 @@ class Reporter {
7676
} else {
7777
this.fails++;
7878
this.stdout.write(chalk`{bgRed.white.bold ${' FAIL '}} {underline ${test}} {bold >} {${timeFormat} ${time}s} {bold >} {bold ${formattedGas} gas} > {red ${message || 'no error message'}}\n`);
79+
this.stdout.write(chalk`{red ${stack}}\n`);
7980
}
8081

8182
this.resetGas();

0 commit comments

Comments
 (0)