c8 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/report.js +1 -0
- package/lib/report.js +2 -17
- package/package.json +3 -3
- package/lib/is-cjs-esm-bridge.js +0 -10
package/lib/commands/report.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.outputReport = async function (argv) {
|
|
|
25
25
|
excludeAfterRemap: argv.excludeAfterRemap,
|
|
26
26
|
reporter: Array.isArray(argv.reporter) ? argv.reporter : [argv.reporter],
|
|
27
27
|
reportsDirectory: argv['reports-dir'],
|
|
28
|
+
reporterOptions: argv.reporterOptions || {},
|
|
28
29
|
tempDirectory: argv.tempDirectory,
|
|
29
30
|
watermarks: argv.watermarks,
|
|
30
31
|
resolve: argv.resolve,
|
package/lib/report.js
CHANGED
|
@@ -14,7 +14,6 @@ const { pathToFileURL, fileURLToPath } = require('url')
|
|
|
14
14
|
const getSourceMapFromFile = require('./source-map-from-file')
|
|
15
15
|
// TODO: switch back to @c88/v8-coverage once patch is landed.
|
|
16
16
|
const v8toIstanbul = require('v8-to-istanbul')
|
|
17
|
-
const isCjsEsmBridgeCov = require('./is-cjs-esm-bridge')
|
|
18
17
|
const util = require('util')
|
|
19
18
|
const debuglog = util.debuglog('c8')
|
|
20
19
|
|
|
@@ -106,7 +105,6 @@ class Report {
|
|
|
106
105
|
v8ProcessCov = this._getMergedProcessCov()
|
|
107
106
|
}
|
|
108
107
|
const resultCountPerPath = new Map()
|
|
109
|
-
const possibleCjsEsmBridges = new Map()
|
|
110
108
|
|
|
111
109
|
for (const v8ScriptCov of v8ProcessCov.result) {
|
|
112
110
|
try {
|
|
@@ -125,26 +123,13 @@ class Report {
|
|
|
125
123
|
resultCountPerPath.set(path, 0)
|
|
126
124
|
}
|
|
127
125
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
path,
|
|
131
|
-
functions: v8ScriptCov.functions
|
|
132
|
-
})
|
|
133
|
-
} else {
|
|
134
|
-
converter.applyCoverage(v8ScriptCov.functions)
|
|
135
|
-
map.merge(converter.toIstanbul())
|
|
136
|
-
}
|
|
126
|
+
converter.applyCoverage(v8ScriptCov.functions)
|
|
127
|
+
map.merge(converter.toIstanbul())
|
|
137
128
|
} catch (err) {
|
|
138
129
|
debuglog(`file: ${v8ScriptCov.url} error: ${err.stack}`)
|
|
139
130
|
}
|
|
140
131
|
}
|
|
141
132
|
|
|
142
|
-
for (const [converter, { path, functions }] of possibleCjsEsmBridges) {
|
|
143
|
-
if (resultCountPerPath.get(path) <= 1) {
|
|
144
|
-
converter.applyCoverage(functions)
|
|
145
|
-
map.merge(converter.toIstanbul())
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
133
|
this._allCoverageFiles = map
|
|
149
134
|
return this._allCoverageFiles
|
|
150
135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c8",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "output coverage reports using Node.js' built in coverage",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"istanbul-lib-coverage": "^3.2.0",
|
|
41
41
|
"istanbul-lib-report": "^3.0.1",
|
|
42
42
|
"istanbul-reports": "^3.1.6",
|
|
43
|
-
"test-exclude": "^
|
|
43
|
+
"test-exclude": "^7.0.1",
|
|
44
44
|
"v8-to-istanbul": "^9.0.0",
|
|
45
45
|
"yargs": "^17.7.2",
|
|
46
46
|
"yargs-parser": "^21.1.1"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript": "^5.0.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
|
-
"node": ">=
|
|
59
|
+
"node": ">=18"
|
|
60
60
|
},
|
|
61
61
|
"files": [
|
|
62
62
|
"index.js",
|
package/lib/is-cjs-esm-bridge.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
module.exports = ({ functions }) => {
|
|
2
|
-
// https://github.com/nodejs/node/blob/v12.1.0/lib/internal/modules/esm/create_dynamic_module.js#L11-L19
|
|
3
|
-
return functions.length === 3 &&
|
|
4
|
-
functions[0].functionName === '' &&
|
|
5
|
-
functions[0].isBlockCoverage === true &&
|
|
6
|
-
functions[1].functionName === 'get' &&
|
|
7
|
-
functions[1].isBlockCoverage === false &&
|
|
8
|
-
functions[2].functionName === 'set' &&
|
|
9
|
-
functions[2].isBlockCoverage === true
|
|
10
|
-
}
|