From e389cccf0939fe4f1dc586382df9050429d2576a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 13 Feb 2020 15:53:04 -0500 Subject: [PATCH] fix(@embark/reporter): show stack trace in the reporter on errors --- packages/plugins/mocha-tests/src/lib/reporter.js | 2 +- packages/stack/test-runner/src/lib/reporter.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/plugins/mocha-tests/src/lib/reporter.js b/packages/plugins/mocha-tests/src/lib/reporter.js index 6a3a3e890..9bb29e8f4 100644 --- a/packages/plugins/mocha-tests/src/lib/reporter.js +++ b/packages/plugins/mocha-tests/src/lib/reporter.js @@ -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); }); } } diff --git a/packages/stack/test-runner/src/lib/reporter.js b/packages/stack/test-runner/src/lib/reporter.js index 10a9dade3..58c7b6ed7 100644 --- a/packages/stack/test-runner/src/lib/reporter.js +++ b/packages/stack/test-runner/src/lib/reporter.js @@ -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();