@vitest/coverage-v8 5.0.0-rc.1 → 5.0.0-rc.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.d.ts +1 -1
- package/dist/provider.js +10 -6
- package/package.json +8 -12
package/dist/provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoverageMap } from 'istanbul-lib-coverage';
|
|
1
|
+
import { CoverageMap } from '@vitest/istanbul-lib-coverage';
|
|
2
2
|
import { ProxifiedModule } from 'magicast';
|
|
3
3
|
import { Profiler } from 'node:inspector';
|
|
4
4
|
import { BaseCoverageProvider, CoverageProvider, Vitest, ReportContext } from 'vitest/node';
|
package/dist/provider.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { existsSync, promises } from 'node:fs';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { mergeScriptCovs } from '@bcoe/v8-coverage';
|
|
4
|
+
import * as libCoverage from '@vitest/istanbul-lib-coverage';
|
|
5
|
+
import * as libReport from '@vitest/istanbul-lib-report';
|
|
4
6
|
import astV8ToIstanbul from 'ast-v8-to-istanbul';
|
|
5
|
-
import libCoverage from 'istanbul-lib-coverage';
|
|
6
|
-
import libReport from 'istanbul-lib-report';
|
|
7
|
-
import reports from 'istanbul-reports';
|
|
8
7
|
import { parseModule } from 'magicast';
|
|
9
8
|
import { createDebug } from 'obug';
|
|
10
9
|
import { provider } from 'std-env';
|
|
@@ -14,7 +13,7 @@ import { c as commands, n as normalize } from './commands-wCiafWY1.js';
|
|
|
14
13
|
import 'node:crypto';
|
|
15
14
|
import 'node:fs/promises';
|
|
16
15
|
|
|
17
|
-
var version = "5.0.0-rc.
|
|
16
|
+
var version = "5.0.0-rc.3";
|
|
18
17
|
|
|
19
18
|
const FILE_PROTOCOL = "file://";
|
|
20
19
|
const debug = createDebug("vitest:coverage");
|
|
@@ -105,11 +104,12 @@ class V8CoverageProvider extends BaseCoverageProvider {
|
|
|
105
104
|
}
|
|
106
105
|
for (const reporter of this.options.reporter) {
|
|
107
106
|
// Type assertion required for custom reporters
|
|
108
|
-
|
|
107
|
+
const reportInstance = await libReport.createAsync(reporter[0], {
|
|
109
108
|
skipFull: this.options.skipFull,
|
|
110
109
|
projectRoot: this.ctx.config.root,
|
|
111
110
|
...reporter[1]
|
|
112
|
-
})
|
|
111
|
+
});
|
|
112
|
+
reportInstance.execute(context);
|
|
113
113
|
}
|
|
114
114
|
if (this.options.thresholds) {
|
|
115
115
|
await this.reportThresholds(coverageMap, allTestsRun);
|
|
@@ -173,6 +173,10 @@ class V8CoverageProvider extends BaseCoverageProvider {
|
|
|
173
173
|
if (type === "statement" && node.type === "VariableDeclarator" && node.id.type === "Identifier" && node.id.name.startsWith("__vite_ssr_import_")) {
|
|
174
174
|
return true;
|
|
175
175
|
}
|
|
176
|
+
// SSR transformed import binding
|
|
177
|
+
if (type === "statement" && node.type === "VariableDeclarator" && node.init && node.init.type === "MemberExpression" && node.init.object.type === "MemberExpression" && node.init.object.object.type === "Identifier" && node.init.object.object.name.startsWith("__vite_ssr_import_")) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
176
180
|
// SSR transformed exports vite@>6.3.5
|
|
177
181
|
if (type === "statement" && node.type === "ExpressionStatement" && node.expression.type === "AssignmentExpression" && node.expression.left.type === "MemberExpression" && node.expression.left.object.type === "Identifier" && node.expression.left.object.name === "__vite_ssr_exports__") {
|
|
178
182
|
return true;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/coverage-v8",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-rc.
|
|
4
|
+
"version": "5.0.0-rc.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": "5.0.0-rc.
|
|
45
|
-
"vitest": "5.0.0-rc.
|
|
44
|
+
"@vitest/browser": "5.0.0-rc.3",
|
|
45
|
+
"vitest": "5.0.0-rc.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@vitest/browser": {
|
|
@@ -51,23 +51,19 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@bcoe/v8-coverage": "^1.0.2",
|
|
54
|
+
"@vitest/istanbul-lib-coverage": "^1.0.0",
|
|
55
|
+
"@vitest/istanbul-lib-report": "^1.0.0",
|
|
54
56
|
"ast-v8-to-istanbul": "^1.0.5",
|
|
55
|
-
"istanbul-lib-coverage": "^3.2.2",
|
|
56
|
-
"istanbul-lib-report": "^3.0.1",
|
|
57
|
-
"istanbul-reports": "^3.2.0",
|
|
58
57
|
"magicast": "^0.5.4",
|
|
59
58
|
"obug": "^2.1.4",
|
|
60
59
|
"std-env": "^4.2.0",
|
|
61
60
|
"tinyrainbow": "^3.1.1"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@types/istanbul-reports": "^3.0.4",
|
|
63
|
+
"@vitest/browser": "5.0.0-rc.3",
|
|
64
|
+
"@vitest/browser-playwright": "5.0.0-rc.3",
|
|
67
65
|
"pathe": "^2.0.3",
|
|
68
|
-
"
|
|
69
|
-
"@vitest/browser-playwright": "5.0.0-rc.1",
|
|
70
|
-
"vitest": "5.0.0-rc.1"
|
|
66
|
+
"vitest": "5.0.0-rc.3"
|
|
71
67
|
},
|
|
72
68
|
"scripts": {
|
|
73
69
|
"build": "premove dist && rollup -c",
|