diff --git a/lib/reporter.js b/lib/reporter.js index 7e8f37e..1e08d3a 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -146,7 +146,7 @@ class Reporter { sendLogOnFinishFailedItem(test, tempTestId) { if (test.status === FAILED) { const sendFailedLogPromise = this.client.sendLog(tempTestId, { - message: test.err, + message: test.err.stack, level: logLevels.ERROR, time: new Date().valueOf(), }).promise; diff --git a/lib/utils.js b/lib/utils.js index 4a181ac..0f43015 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -137,7 +137,7 @@ const getTestInfo = (test, testFileName, status, err) => ({ title: test.title, codeRef: getCodeRef(test.titlePath(), testFileName), parentId: test.parent.id, - err: (err && err.message) || err || (test.err && test.err.message), + err: err || test.err, testFileName, }); diff --git a/test/utils.test.js b/test/utils.test.js index 2b54b33..7025767 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -472,7 +472,7 @@ describe('utils script', () => { status: 'failed', parentId: 'parentSuiteId', codeRef: 'test/example.spec.js/suite name/test name', - err: 'error message', + err: { message: 'error message' }, testFileName, };