fix(@embark/reporter): show stack trace in the reporter on errors

This commit is contained in:
Jonathan Rainville 2020-02-13 15:53:04 -05:00 committed by Iuri Matias
parent c07ac55d70
commit e389cccf09
2 changed files with 3 additions and 2 deletions

View File

@ -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);
});
}
}

View File

@ -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();