mirror of https://github.com/embarklabs/embark.git
fix(@embark/reporter): show stack trace in the reporter on errors
This commit is contained in:
parent
c07ac55d70
commit
e389cccf09
|
@ -26,7 +26,7 @@ class Reporter {
|
|||
})
|
||||
.on(EVENT_TEST_FAIL, (test, err) => {
|
||||
const duration = (Date.now() - startTime) / 1000.0;
|
||||
this.reporter.report(test.fullTitle(), duration, false, err.message);
|
||||
this.reporter.report(test.fullTitle(), duration, false, err.message, err.stack);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class Reporter {
|
|||
}
|
||||
}
|
||||
|
||||
report(test, time, passed, message) {
|
||||
report(test, time, passed, message, stack) {
|
||||
let timeFormat = 'green';
|
||||
if (time > 0.7) {
|
||||
timeFormat = 'yellow';
|
||||
|
@ -76,6 +76,7 @@ class Reporter {
|
|||
} else {
|
||||
this.fails++;
|
||||
this.stdout.write(chalk`{bgRed.white.bold ${' FAIL '}} {underline ${test}} {bold >} {${timeFormat} ${time}s} {bold >} {bold ${formattedGas} gas} > {red ${message || 'no error message'}}\n`);
|
||||
this.stdout.write(chalk`{red ${stack}}\n`);
|
||||
}
|
||||
|
||||
this.resetGas();
|
||||
|
|
Loading…
Reference in New Issue