karma-coverage-istanbul-reporter
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [3.0.1](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/compare/v3.0.0...v3.0.1) (2020-05-04) | ||
### Bug Fixes | ||
* set correct process exit code when thresholds are not met ([9ba3fe0](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/commit/9ba3fe0acf3ee778518c154a8dd050584f47bc13)), closes [#80](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/issues/80) | ||
## [3.0.0](https://github.com/mattlewis92/karma-coverage-istanbul-reporter/compare/v2.1.1...v3.0.0) (2020-05-01) | ||
@@ -13,2 +20,4 @@ | ||
* If using threshold reporting and the programmatic karma api, then the exitCode will no longer be returned as 1 when thresholds are not met. | ||
### Features | ||
@@ -222,2 +231,2 @@ | ||
* Initial release | ||
* Initial release |
{ | ||
"name": "karma-coverage-istanbul-reporter", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A karma reporter that uses the latest istanbul 1.x APIs (with full sourcemap support) to report coverage.", | ||
@@ -69,2 +69,3 @@ "funding": { | ||
"rimraf": "^3.0.2", | ||
"sinon": "^9.0.2", | ||
"standard-version": "^7.1.0", | ||
@@ -117,3 +118,6 @@ "ts-loader": "^7.0.2", | ||
} | ||
}, | ||
"mocha": { | ||
"timeout": 10000 | ||
} | ||
} |
@@ -77,3 +77,3 @@ const path = require('path'); | ||
async function createReport(browserOrBrowsers, results) { | ||
async function createReport(browserOrBrowsers) { | ||
const reportConfigOverride = | ||
@@ -200,4 +200,6 @@ !coverageConfig.combineBrowserReports && coverageConfig.dir | ||
if (thresholdCheckFailed && results && !thresholds.emitWarning) { | ||
results.exitCode = 1; | ||
if (thresholdCheckFailed && !thresholds.emitWarning && config.singleRun) { | ||
process.on('exit', () => { | ||
process.exit(1); | ||
}); | ||
} | ||
@@ -231,11 +233,9 @@ } | ||
const baseReporterOnRunComplete = this.onRunComplete; | ||
this.onRunComplete = async function (browsers, results) { | ||
this.onRunComplete = async function (browsers) { | ||
Reflect.apply(baseReporterOnRunComplete, this, arguments); | ||
if (coverageConfig.combineBrowserReports) { | ||
await createReport(browsers, results); | ||
await createReport(browsers); | ||
} else { | ||
await Promise.all( | ||
browsers.map((browser) => createReport(browser, results)) | ||
); | ||
await Promise.all(browsers.map((browser) => createReport(browser))); | ||
} | ||
@@ -242,0 +242,0 @@ }; |
29814
28