json-reporter
Advanced tools
Comparing version 1.0.0 to 1.2.0
@@ -5,2 +5,22 @@ # Change Log | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/gemini-testing/json-reporter/compare/v1.0.0...v1.2.0) (2018-12-29) | ||
### Features | ||
* save stacktraces ([6877242](https://github.com/gemini-testing/json-reporter/commit/6877242)) | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/gemini-testing/json-reporter/compare/v1.0.0...v1.1.0) (2018-12-29) | ||
### Features | ||
* save stacktraces ([6877242](https://github.com/gemini-testing/json-reporter/commit/6877242)) | ||
<a name="1.0.0"></a> | ||
@@ -7,0 +27,0 @@ # [1.0.0](https://github.com/gemini-testing/json-reporter/compare/v0.6.0...v1.0.0) (2018-11-29) |
@@ -19,3 +19,2 @@ 'use strict'; | ||
hermione.on(hermione.events.TEST_FAIL, (data) => collector.addFail(data)); | ||
hermione.on(hermione.events.SUITE_FAIL, (data) => collector.addFail(data)); | ||
@@ -22,0 +21,0 @@ hermione.on(hermione.events.TEST_PENDING, (data) => collector.addSkipped(data)); |
@@ -26,4 +26,4 @@ 'use strict'; | ||
this._data[id] = test; | ||
super.append(test); | ||
} | ||
}; |
@@ -5,2 +5,8 @@ 'use strict'; | ||
function customMerger(objValue, srcValue) { | ||
if (_.isArray(objValue)) { | ||
return objValue.concat(srcValue); | ||
} | ||
} | ||
module.exports = class DataCollector { | ||
@@ -18,2 +24,7 @@ static create() { | ||
if (this._data[id]) { | ||
this._data[id] = _.mergeWith(this._data[id], test, customMerger); | ||
return; | ||
} | ||
this._data[id] = test; | ||
@@ -20,0 +31,0 @@ } |
@@ -20,2 +20,8 @@ 'use strict'; | ||
} | ||
addRetry(result) { | ||
this._toolCollector.isFailedTest(result) | ||
? this.addFail(result) | ||
: this.addError(result); | ||
} | ||
}; |
@@ -25,3 +25,9 @@ 'use strict'; | ||
addFail(result) { | ||
this._addTestResult(result, {status: 'fail'}); | ||
const error = result.err.stack; | ||
this._addTestResult(result, { | ||
status: 'fail', | ||
errorReason: error, | ||
retries: [{error}] | ||
}); | ||
} | ||
@@ -37,11 +43,12 @@ | ||
addRetry(result) { | ||
this._toolCollector.isFailedTest(result) | ||
? this.addFail(result) | ||
: this.addError(result); | ||
this.addFail(result); | ||
} | ||
addError(result) { | ||
const error = result.stack || result.message || ''; | ||
this._addTestResult(result, { | ||
status: 'error', | ||
errorReason: result.stack || result.message || '' | ||
errorReason: error, | ||
retries: [{error}] | ||
}); | ||
@@ -48,0 +55,0 @@ } |
@@ -27,6 +27,2 @@ 'use strict'; | ||
exports.isFailedTest = (result) => { | ||
return result.state === 'failed' || result.hook && result.hook.state === 'failed'; | ||
}; | ||
exports.getSkipReason = (result) => { | ||
@@ -33,0 +29,0 @@ const findSkipReason = (test) => test.parent && findSkipReason(test.parent) || test.skipReason; |
{ | ||
"name": "json-reporter", | ||
"version": "1.0.0", | ||
"version": "1.2.0", | ||
"description": "Common plugin for gemini and hermione which is intended to aggregate the results of tests running", | ||
@@ -5,0 +5,0 @@ "main": "gemini.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18327
248
1