@vitest/coverage-v8 4.0.0-beta.2 → 4.0.0-beta.3
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/dist/provider.js +6 -5
- package/package.json +6 -8
package/dist/provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { mergeProcessCovs } from '@bcoe/v8-coverage';
|
|
4
4
|
import astV8ToIstanbul from 'ast-v8-to-istanbul';
|
|
5
5
|
import createDebug from 'debug';
|
|
@@ -141,7 +141,7 @@ new Set([
|
|
|
141
141
|
"wasi"
|
|
142
142
|
]);
|
|
143
143
|
|
|
144
|
-
var version = "4.0.0-beta.
|
|
144
|
+
var version = "4.0.0-beta.3";
|
|
145
145
|
|
|
146
146
|
const FILE_PROTOCOL = "file://";
|
|
147
147
|
const debug = createDebug("vitest:coverage");
|
|
@@ -239,9 +239,10 @@ class V8CoverageProvider extends BaseCoverageProvider {
|
|
|
239
239
|
start = performance.now();
|
|
240
240
|
timeout = setTimeout(() => debug(c.bgRed(`File "${filename}" is taking longer than 3s`)), 3e3);
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
|
|
242
|
+
// Do not use pathToFileURL to avoid encoding filename parts
|
|
243
|
+
const url = `file://${filename.startsWith("/") ? "" : "/"}${filename}`;
|
|
244
|
+
const sources = await this.getSources(url, transformResults, transform);
|
|
245
|
+
coverageMap.merge(await this.remapCoverage(url, 0, sources, []));
|
|
245
246
|
if (debug.enabled) {
|
|
246
247
|
clearTimeout(timeout);
|
|
247
248
|
const diff = performance.now() - start;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/coverage-v8",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.3",
|
|
5
5
|
"description": "V8 coverage provider for Vitest",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@vitest/browser": "4.0.0-beta.
|
|
45
|
-
"vitest": "4.0.0-beta.
|
|
44
|
+
"@vitest/browser": "4.0.0-beta.3",
|
|
45
|
+
"vitest": "4.0.0-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@vitest/browser": {
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@ampproject/remapping": "^2.3.0",
|
|
54
53
|
"@bcoe/v8-coverage": "^1.0.2",
|
|
55
54
|
"ast-v8-to-istanbul": "^0.3.3",
|
|
56
55
|
"debug": "^4.4.1",
|
|
@@ -58,7 +57,6 @@
|
|
|
58
57
|
"istanbul-lib-report": "^3.0.1",
|
|
59
58
|
"istanbul-lib-source-maps": "^5.0.6",
|
|
60
59
|
"istanbul-reports": "^3.1.7",
|
|
61
|
-
"magic-string": "^0.30.17",
|
|
62
60
|
"magicast": "^0.3.5",
|
|
63
61
|
"std-env": "^3.9.0",
|
|
64
62
|
"tinyrainbow": "^2.0.0"
|
|
@@ -70,9 +68,9 @@
|
|
|
70
68
|
"@types/istanbul-lib-source-maps": "^4.0.4",
|
|
71
69
|
"@types/istanbul-reports": "^3.0.4",
|
|
72
70
|
"pathe": "^2.0.3",
|
|
73
|
-
"
|
|
74
|
-
"vite-node": "4.0.0-beta.
|
|
75
|
-
"vitest": "4.0.0-beta.
|
|
71
|
+
"vitest": "4.0.0-beta.3",
|
|
72
|
+
"vite-node": "4.0.0-beta.3",
|
|
73
|
+
"@vitest/browser": "4.0.0-beta.3"
|
|
76
74
|
},
|
|
77
75
|
"scripts": {
|
|
78
76
|
"build": "rimraf dist && rollup -c",
|