Skip to content

Commit 99fe37f

Browse files
RolandArgoscharlierudolph
authored andcommitted
revert json formatter duration to nanoseconds (#968)
1 parent de65b7e commit 99fe37f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
1616
* add snippet interface "async-await"
1717
* add `--parallel <NUMBER_OF_SLAVES>` option to run tests in parallel. Note this is an experimental feature. See [here](/docs/cli.md#parallel-experimental) for more information
1818

19+
#### Bug Fixes
20+
21+
* revert json formatter duration to nanoseconds
22+
1923
#### Deprecations
2024

2125
* `defineSupportCode` is deprecated. Require/import the individual methods instead

src/formatter/json_formatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default class JsonFormatter extends Formatter {
145145
const { result: { exception, status } } = testStep
146146
data.result = { status }
147147
if (testStep.result.duration) {
148-
data.result.duration = testStep.result.duration
148+
data.result.duration = testStep.result.duration * 1000000
149149
}
150150
if (status === Status.FAILED && exception) {
151151
data.result.error_message = format(exception)

src/formatter/json_formatter_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('JsonFormatter', function() {
9494
name: 'my step',
9595
result: {
9696
status: 'passed',
97-
duration: 1
97+
duration: 1000000
9898
}
9999
}
100100
],
@@ -139,7 +139,7 @@ describe('JsonFormatter', function() {
139139
expect(features[0].elements[0].steps[0].result).to.eql({
140140
status: 'failed',
141141
error_message: 'my error',
142-
duration: 1
142+
duration: 1000000
143143
})
144144
})
145145
})

0 commit comments

Comments
 (0)