diff --git a/CHANGELOG.md b/CHANGELOG.md index e49c8353a..8274b958d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO * add `--require-module` to require node modules before support code is loaded * add snippet interface "async-await" +#### Bug Fixes + +* revert json formatter duration to nanoseconds + #### Deprecations * `defineSupportCode` is deprecated. Require/import the individual methods instead diff --git a/src/formatter/json_formatter.js b/src/formatter/json_formatter.js index 28d5c8c0c..d04825c70 100644 --- a/src/formatter/json_formatter.js +++ b/src/formatter/json_formatter.js @@ -145,7 +145,7 @@ export default class JsonFormatter extends Formatter { const { result: { exception, status } } = testStep data.result = { status } if (testStep.result.duration) { - data.result.duration = testStep.result.duration + data.result.duration = testStep.result.duration * 1000000 } if (status === Status.FAILED && exception) { data.result.error_message = format(exception) diff --git a/src/formatter/json_formatter_spec.js b/src/formatter/json_formatter_spec.js index 2f7cd06f0..602cc6cba 100644 --- a/src/formatter/json_formatter_spec.js +++ b/src/formatter/json_formatter_spec.js @@ -94,7 +94,7 @@ describe('JsonFormatter', function() { name: 'my step', result: { status: 'passed', - duration: 1 + duration: 1000000 } } ], @@ -139,7 +139,7 @@ describe('JsonFormatter', function() { expect(features[0].elements[0].steps[0].result).to.eql({ status: 'failed', error_message: 'my error', - duration: 1 + duration: 1000000 }) }) })