Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert step duration from ms to ns for JSON Formatter #807

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Convert step duration from ms to ns for JSON Formatter
  • Loading branch information
Gabriel Pichot committed Mar 31, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2f2ced11d06707b65a925d093f39572faf1478ec
3 changes: 2 additions & 1 deletion src/formatter/json_formatter.js
Original file line number Diff line number Diff line change
@@ -105,7 +105,8 @@ export default class JsonFormatter extends Formatter {
}

if (status === Status.PASSED || status === Status.FAILED) {
currentStep.result.duration = stepResult.duration
// Convert ms to ns
currentStep.result.duration = stepResult.duration * 1e6
}

if (_.size(stepResult.attachments) > 0) {
4 changes: 2 additions & 2 deletions src/formatter/json_formatter_spec.js
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ describe('JsonFormatter', function () {
name: 'A Step Name',
result: {
status: 'passed',
duration: 1
duration: 1000000
}
}])
})
@@ -150,7 +150,7 @@ describe('JsonFormatter', function () {
expect(features[0].elements[0].steps[0].result).to.eql({
status: 'failed',
error_message: 'failure stack',
duration: 1
duration: 1000000
})
})
})