Skip to content

Commit ea54a7c

Browse files
committed
exception message in json formatter
1 parent a412c96 commit ea54a7c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"node": ">=0.10"
133133
},
134134
"dependencies": {
135-
"assertion-error-formatter": "^2.0.0",
135+
"assertion-error-formatter": "^2.0.1",
136136
"babel-runtime": "^6.11.6",
137137
"bluebird": "^3.4.1",
138138
"cli-table": "^0.3.1",

src/formatter/json_formatter.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Formatter from './'
33
import Status from '../status'
44
import { formatLocation, GherkinDocumentParser, PickleParser } from './helpers'
55
import { buildStepArgumentIterator } from '../step_arguments'
6+
import { format } from 'assertion-error-formatter'
67

78
const {
89
getStepLineToKeywordMap,
@@ -156,7 +157,7 @@ export default class JsonFormatter extends Formatter {
156157
data.result.duration = testStep.result.duration
157158
}
158159
if (status === Status.FAILED && exception) {
159-
data.result.error_message = exception.stack || exception
160+
data.result.error_message = format(exception)
160161
}
161162
}
162163
if (_.size(testStep.attachments) > 0) {

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ assert@^1.4.0:
193193
dependencies:
194194
util "0.10.3"
195195

196-
assertion-error-formatter@^2.0.0:
197-
version "2.0.0"
198-
resolved "https://registry.yarnpkg.com/assertion-error-formatter/-/assertion-error-formatter-2.0.0.tgz#17a24289cc8440889b54318e6d1187ebee2d5494"
196+
assertion-error-formatter@^2.0.1:
197+
version "2.0.1"
198+
resolved "https://registry.yarnpkg.com/assertion-error-formatter/-/assertion-error-formatter-2.0.1.tgz#6bbdffaec8e2fa9e2b0eb158bfe353132d7c0a9b"
199199
dependencies:
200200
diff "^3.0.0"
201201
pad-right "^0.2.2"

0 commit comments

Comments
 (0)