Skip to content

Commit 54560bd

Browse files
committed
exception message in json formatter
1 parent 7bb5a3b commit 54560bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/formatter/json_formatter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ export default class JsonFormatter extends Formatter {
156156
data.result.duration = testStep.result.duration
157157
}
158158
if (status === Status.FAILED && exception) {
159-
data.result.error_message = exception.stack || exception
159+
let message = exception.message || ''
160+
let stack = exception.stack || ''
161+
message = _.includes(stack, message) ? '' : message + '\n'
162+
data.result.error_message = message + stack || exception
160163
}
161164
}
162165
if (_.size(testStep.attachments) > 0) {

0 commit comments

Comments
 (0)