Comparing version 3.3.0-candidate.0 to 3.3.0-candidate.1
const Exclude = require('test-exclude') | ||
const furi = require('furi') | ||
const libCoverage = require('istanbul-lib-coverage') | ||
@@ -7,3 +8,4 @@ const libReport = require('istanbul-lib-report') | ||
const { resolve, isAbsolute } = require('path') | ||
const { mergeProcessCovs } = require('@c88/v8-coverage') | ||
// TODO: switch back to @c88/v8-coverage once patch is landed. | ||
const { mergeProcessCovs } = require('@bcoe/v8-coverage') | ||
const v8toIstanbul = require('v8-to-istanbul') | ||
@@ -78,3 +80,3 @@ | ||
for (const v8ProcessCov of this._loadReports()) { | ||
v8ProcessCovs.push(this._filterProcessCov(v8ProcessCov)) | ||
v8ProcessCovs.push(this._normalizeProcessCov(v8ProcessCov)) | ||
} | ||
@@ -106,4 +108,8 @@ return mergeProcessCovs(v8ProcessCovs) | ||
/** | ||
* Returns a filtered process coverage. | ||
* Normalizes a process coverage. | ||
* | ||
* This function replaces file URLs (`url` property) by their corresponding | ||
* system-dependent path and applies the current inclusion rules to filter out | ||
* the excluded script coverages. | ||
* | ||
* The result is a copy of the input, with script coverages filtered based | ||
@@ -113,11 +119,12 @@ * on their `url` and the current inclusion rules. | ||
* | ||
* @param v8ProcessCov V8 process coverage to filter. | ||
* @return {v8ProcessCov} Filtered V8 process coverage. | ||
* @param v8ProcessCov V8 process coverage to normalize. | ||
* @return {v8ProcessCov} Normalized V8 process coverage. | ||
* @private | ||
*/ | ||
_filterProcessCov (v8ProcessCov) { | ||
_normalizeProcessCov (v8ProcessCov) { | ||
const result = [] | ||
for (const v8ScriptCov of v8ProcessCov.result) { | ||
// TODO: implement real fix from https://github.com/nodejs/node/issues/23783 | ||
v8ScriptCov.url = v8ScriptCov.url.replace(/^file:\/\//, '') | ||
if (/^file:\/\//.test(v8ScriptCov.url)) { | ||
v8ScriptCov.url = furi.toSysPath(v8ScriptCov.url) | ||
} | ||
if (this.exclude.shouldInstrument(v8ScriptCov.url) && | ||
@@ -124,0 +131,0 @@ (!this.omitRelative || isAbsolute(v8ScriptCov.url))) { |
{ | ||
"name": "c8", | ||
"version": "3.3.0-candidate.0", | ||
"version": "3.3.0-candidate.1", | ||
"description": "output coverage reports using Node.js' built in coverage", | ||
@@ -35,5 +35,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"@c88/v8-coverage": "^0.1.0", | ||
"@bcoe/v8-coverage": "^0.1.0", | ||
"find-up": "^3.0.0", | ||
"foreground-child": "^1.5.6", | ||
"furi": "^1.0.0", | ||
"istanbul-lib-coverage": "^2.0.1", | ||
@@ -40,0 +41,0 @@ "istanbul-lib-report": "^2.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14138
242
13
+ Added@bcoe/v8-coverage@^0.1.0
+ Addedfuri@^1.0.0
+ Added@bcoe/v8-coverage@0.1.0(transitive)
+ Added@types/is-windows@0.2.0(transitive)
+ Addedfuri@1.3.0(transitive)
+ Addedis-windows@1.0.2(transitive)
- Removed@c88/v8-coverage@^0.1.0
- Removed@c88/v8-coverage@0.1.1(transitive)