Skip to content

Commit

Permalink
cucumber version@4 reverted the milliseconds to nanoseconds (#131)
Browse files Browse the repository at this point in the history
* cucumber version@4 reverted the milliseconds to nanoseconds

* changelog

* update to cucumber-4

* change log
  • Loading branch information
gkushang authored Feb 2, 2018
1 parent 61c7f3d commit ee96d51
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 67 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 4.0.0 (Feb-02-2018)

* Support for Cucumber 4. Duration is now in Nanoseconds.
* Fix issue: [#130](https://github.com/gkushang/cucumber-html-reporter/issues/130)

### 3.0.4 (Sep-20-2017)

* Fix for Cucumber V2, mime_type
Expand Down
5 changes: 4 additions & 1 deletion lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ var generateReport = function (options) {
* Sample Input: "2005366787"
* Sample Output: "2s 5ms"
*/
var calculateDuration = function (durationInMillis) {
var calculateDuration = function (durationInNanoSeconds) {
// convert it to MILLI_SECONDS
var durationInMillis = _.floor(durationInNanoSeconds / 1000000);

var oneMilliSecond = 1000;
var oneMinute = 60 * oneMilliSecond;
var formattedDuration = '0s';
Expand Down
128 changes: 64 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
],
"scripts": {
"pretest": "node node_modules/cucumber/bin/cucumber test/features/ -r test/features/step_definitions -f json:test/report/cucumber_report.json --no-strict || true",
"pretest": "node node_modules/cucumber/bin/cucumber-js test/features/ -r test/features/step_definitions -f json:test/report/cucumber_report.json --no-strict || true",
"test": "node test/createHtmlReports.js",
"posttest": "rm -rf test/report/*.html test/report/*.json test/report/screenshot screenshots"
},
Expand Down Expand Up @@ -85,6 +85,6 @@
},
"devDependencies": {
"chai": "^3.5.0",
"cucumber": "^3.0.2"
"cucumber": "^4.0.0"
}
}

0 comments on commit ee96d51

Please sign in to comment.