Skip to content

Commit

Permalink
Merge pull request #11 from Bubbit/master
Browse files Browse the repository at this point in the history
The combine function would crash if a suite had no tests.
  • Loading branch information
fijijavis authored Apr 6, 2017
2 parents 4b64b49 + 5822a69 commit b6f34d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ class JsonReporter extends events.EventEmitter {

for (const json of resultJsons) {
resultSet.suites.push.apply(resultSet.suites, json.suites);
resultSet.state.passed += json.state.passed
resultSet.state.skipped += json.state.skipped
resultSet.state.failed += json.state.failed
if (json.state) {
resultSet.state.passed += json.state.passed
resultSet.state.skipped += json.state.skipped
resultSet.state.failed += json.state.failed
}
}

this.write (resultSet, resultJsons[0].capabilities.browserName)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wdio-json-reporter",
"version": "0.2.0",
"version": "0.2.1",
"description": "A WebdriverIO plugin. Report results in json format.",
"main": "build/reporter.js",
"scripts": {
Expand Down

0 comments on commit b6f34d0

Please sign in to comment.