vitest 2.0.0-beta.10 → 2.0.0-beta.11
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/browser.d.ts +1 -1
- package/dist/browser.js +3 -3
- package/dist/chunks/{integrations-globals.C6Ah-pUW.js → integrations-globals.CC2ed6Py.js} +9 -9
- package/dist/chunks/{node-git.CCI8evVZ.js → node-git.ZtkbKc8u.js} +14 -15
- package/dist/chunks/{runtime-console.DiVMr5d4.js → runtime-console.Ckl0vEQr.js} +25 -10
- package/dist/chunks/{runtime-runBaseTests.Cukyr5-I.js → runtime-runBaseTests.BXW_BJeO.js} +40 -32
- package/dist/cli.js +3 -3
- package/dist/config.cjs +42 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +42 -20
- package/dist/coverage.d.ts +4 -4
- package/dist/coverage.js +98 -36
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +34 -8
- package/dist/index.js +9 -9
- package/dist/node.d.ts +19 -6
- package/dist/node.js +24 -16
- package/dist/path.js +4 -1
- package/dist/{reporters-CYVC6LOl.d.ts → reporters-fiIq_dT9.d.ts} +118 -179
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +7 -7
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +98 -60
- package/dist/{suite-Dpu9EC_k.d.ts → suite-D4aoU9rI.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/suite.js +2 -2
- package/dist/utils.d.ts +1 -5
- package/dist/utils.js +1 -6
- package/dist/vendor/{base.Dln9yllP.js → base.C2DbLEfT.js} +4 -3
- package/dist/vendor/{base._gnK9Slw.js → base.CTYV4Gnz.js} +24 -17
- package/dist/vendor/{benchmark.BNLebNi5.js → benchmark.CMp8QfyL.js} +13 -14
- package/dist/vendor/{cac.CtYFkoSJ.js → cac.BcJW7n2j.js} +71 -37
- package/dist/vendor/{cli-api.CUtJc4r3.js → cli-api.C8t8m4__.js} +4012 -4828
- package/dist/vendor/{constants.TCjCaw2D.js → constants.BWsVtsAj.js} +5 -22
- package/dist/vendor/{coverage.ChSqD-qS.js → coverage.BhYSDdTT.js} +27 -11
- package/dist/vendor/{date.BKM1wewY.js → date.W2xKR2qe.js} +5 -3
- package/dist/vendor/{execute.BHj6OMh4.js → execute.T3gg2ZK6.js} +174 -60
- package/dist/vendor/{index.B5SKBLvV.js → index.-dbR4KUi.js} +17 -9
- package/dist/vendor/{index.BOMEjpjj.js → index.BC5zhX9y.js} +960 -469
- package/dist/vendor/{index.CThipSqB.js → index.BMmMjLIQ.js} +2540 -2540
- package/dist/vendor/{index._7XLd8Kd.js → index.C9Thslzw.js} +2 -1
- package/dist/vendor/{index.D3hs2WiI.js → index.CQJ2m700.js} +3 -3
- package/dist/vendor/{index.kpsSqFiz.js → index.D4nqnQWz.js} +69 -73
- package/dist/vendor/{rpc.DRDE9Pu1.js → rpc.BGx7q_k2.js} +30 -19
- package/dist/vendor/{run-once.DLomgGUH.js → run-once.Db8Hgq9X.js} +2 -1
- package/dist/vendor/{setup-common.DAu7t7mY.js → setup-common.uqZOEWuR.js} +30 -15
- package/dist/vendor/{tasks.WC7M-K-v.js → tasks.DhVtQBtW.js} +3 -1
- package/dist/vendor/{utils.YuQ3LT2a.js → utils.DSO2UK15.js} +40 -25
- package/dist/vendor/{utils.CUjzkRH7.js → utils.DkxLWvS1.js} +12 -5
- package/dist/vendor/{vi.hATFzZbX.js → vi.BPjl8cAZ.js} +266 -137
- package/dist/vendor/{vm.Ow-X2mkS.js → vm.CycSoHnJ.js} +151 -86
- package/dist/worker.js +31 -15
- package/dist/workers/forks.js +4 -4
- package/dist/workers/runVmTests.js +14 -13
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +6 -6
- package/dist/workers/vmThreads.js +6 -6
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +9 -9
- package/package.json +11 -11
- package/suppress-warnings.cjs +1 -4
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-
|
|
2
|
+
import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-fiIq_dT9.js';
|
|
3
3
|
import { VitestExecutor } from './execute.js';
|
|
4
4
|
import * as spy$1 from '@vitest/spy';
|
|
5
5
|
import 'vite';
|
package/dist/browser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { processError, startTests } from '@vitest/runner';
|
|
2
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.
|
|
3
|
-
export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.
|
|
2
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.uqZOEWuR.js';
|
|
3
|
+
export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.BhYSDdTT.js';
|
|
4
4
|
export { s as SpyModule } from './vendor/spy.Cf_4R5Oe.js';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
|
-
import './vendor/run-once.
|
|
7
|
+
import './vendor/run-once.Db8Hgq9X.js';
|
|
8
8
|
import './vendor/global.7bFbnyXl.js';
|
|
9
9
|
import '@vitest/spy';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { g as globalApis } from '../vendor/constants.
|
|
2
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
1
|
+
import { g as globalApis } from '../vendor/constants.BWsVtsAj.js';
|
|
2
|
+
import { V as VitestIndex } from '../vendor/index.CQJ2m700.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
|
-
import '../vendor/benchmark.
|
|
4
|
+
import '../vendor/benchmark.CMp8QfyL.js';
|
|
5
5
|
import '@vitest/runner/utils';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import '../vendor/index.
|
|
7
|
+
import '../vendor/index.C9Thslzw.js';
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import '../vendor/global.7bFbnyXl.js';
|
|
10
10
|
import '../vendor/env.bmJgw1qP.js';
|
|
11
11
|
import 'std-env';
|
|
12
|
-
import '../vendor/run-once.
|
|
13
|
-
import '../vendor/vi.
|
|
12
|
+
import '../vendor/run-once.Db8Hgq9X.js';
|
|
13
|
+
import '../vendor/vi.BPjl8cAZ.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
16
16
|
import '@vitest/expect';
|
|
17
17
|
import '@vitest/snapshot';
|
|
18
18
|
import '@vitest/utils/error';
|
|
19
|
-
import '../vendor/tasks.
|
|
19
|
+
import '../vendor/tasks.DhVtQBtW.js';
|
|
20
20
|
import '@vitest/utils/source-map';
|
|
21
|
-
import '../vendor/base.
|
|
22
|
-
import '../vendor/date.
|
|
21
|
+
import '../vendor/base.CTYV4Gnz.js';
|
|
22
|
+
import '../vendor/date.W2xKR2qe.js';
|
|
23
23
|
import '@vitest/spy';
|
|
24
24
|
|
|
25
25
|
function registerApiGlobally() {
|
|
@@ -18,8 +18,9 @@ class VitestGit {
|
|
|
18
18
|
}
|
|
19
19
|
async findChangedFiles(options) {
|
|
20
20
|
const root = await this.getRoot(this.cwd);
|
|
21
|
-
if (!root)
|
|
21
|
+
if (!root) {
|
|
22
22
|
return null;
|
|
23
|
+
}
|
|
23
24
|
this.root = root;
|
|
24
25
|
const changedSince = options.changedSince;
|
|
25
26
|
if (typeof changedSince === "string") {
|
|
@@ -37,24 +38,22 @@ class VitestGit {
|
|
|
37
38
|
return [...staged, ...unstaged];
|
|
38
39
|
}
|
|
39
40
|
getFilesSince(hash) {
|
|
40
|
-
return this.resolveFilesWithGitCommand(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
return this.resolveFilesWithGitCommand([
|
|
42
|
+
"diff",
|
|
43
|
+
"--name-only",
|
|
44
|
+
`${hash}...HEAD`
|
|
45
|
+
]);
|
|
43
46
|
}
|
|
44
47
|
getStagedFiles() {
|
|
45
|
-
return this.resolveFilesWithGitCommand(
|
|
46
|
-
["diff", "--cached", "--name-only"]
|
|
47
|
-
);
|
|
48
|
+
return this.resolveFilesWithGitCommand(["diff", "--cached", "--name-only"]);
|
|
48
49
|
}
|
|
49
50
|
getUnstagedFiles() {
|
|
50
|
-
return this.resolveFilesWithGitCommand(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]
|
|
57
|
-
);
|
|
51
|
+
return this.resolveFilesWithGitCommand([
|
|
52
|
+
"ls-files",
|
|
53
|
+
"--other",
|
|
54
|
+
"--modified",
|
|
55
|
+
"--exclude-standard"
|
|
56
|
+
]);
|
|
58
57
|
}
|
|
59
58
|
async getRoot(cwd) {
|
|
60
59
|
const options = ["rev-parse", "--show-cdup"];
|
|
@@ -2,7 +2,7 @@ import { Writable } from 'node:stream';
|
|
|
2
2
|
import { Console } from 'node:console';
|
|
3
3
|
import { relative } from 'node:path';
|
|
4
4
|
import { getSafeTimers, getColors } from '@vitest/utils';
|
|
5
|
-
import { R as RealDate } from '../vendor/date.
|
|
5
|
+
import { R as RealDate } from '../vendor/date.W2xKR2qe.js';
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
@@ -13,15 +13,18 @@ const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
|
13
13
|
function getTaskIdByStack(root) {
|
|
14
14
|
var _a, _b;
|
|
15
15
|
const stack = (_a = new Error("STACK_TRACE_ERROR").stack) == null ? void 0 : _a.split("\n");
|
|
16
|
-
if (!stack)
|
|
16
|
+
if (!stack) {
|
|
17
17
|
return UNKNOWN_TEST_ID;
|
|
18
|
+
}
|
|
18
19
|
const index = stack.findIndex((line2) => line2.includes("at Console.value"));
|
|
19
20
|
const line = index === -1 ? null : stack[index + 2];
|
|
20
|
-
if (!line)
|
|
21
|
+
if (!line) {
|
|
21
22
|
return UNKNOWN_TEST_ID;
|
|
23
|
+
}
|
|
22
24
|
const filepath = (_b = line.match(/at\s(.*)\s?/)) == null ? void 0 : _b[1];
|
|
23
|
-
if (filepath)
|
|
25
|
+
if (filepath) {
|
|
24
26
|
return relative(root, filepath);
|
|
27
|
+
}
|
|
25
28
|
return UNKNOWN_TEST_ID;
|
|
26
29
|
}
|
|
27
30
|
function createCustomConsole(defaultState) {
|
|
@@ -53,8 +56,9 @@ function createCustomConsole(defaultState) {
|
|
|
53
56
|
function sendBuffer(type, taskId) {
|
|
54
57
|
const buffers = type === "stdout" ? stdoutBuffer : stderrBuffer;
|
|
55
58
|
const buffer = buffers.get(taskId);
|
|
56
|
-
if (!buffer)
|
|
59
|
+
if (!buffer) {
|
|
57
60
|
return;
|
|
61
|
+
}
|
|
58
62
|
if (state().config.printConsoleTrace) {
|
|
59
63
|
buffer.forEach(([buffer2, origin]) => {
|
|
60
64
|
sendLog(type, taskId, String(buffer2), buffer2.length, origin);
|
|
@@ -65,10 +69,11 @@ function createCustomConsole(defaultState) {
|
|
|
65
69
|
}
|
|
66
70
|
const timer = timers.get(taskId);
|
|
67
71
|
buffers.set(taskId, []);
|
|
68
|
-
if (type === "stderr")
|
|
72
|
+
if (type === "stderr") {
|
|
69
73
|
timer.stderrTime = 0;
|
|
70
|
-
else
|
|
74
|
+
} else {
|
|
71
75
|
timer.stdoutTime = 0;
|
|
76
|
+
}
|
|
72
77
|
}
|
|
73
78
|
function sendLog(type, taskId, content, size, origin) {
|
|
74
79
|
const timer = timers.get(taskId);
|
|
@@ -91,7 +96,11 @@ function createCustomConsole(defaultState) {
|
|
|
91
96
|
if (timer) {
|
|
92
97
|
timer.stdoutTime = timer.stdoutTime || RealDate.now();
|
|
93
98
|
} else {
|
|
94
|
-
timer = {
|
|
99
|
+
timer = {
|
|
100
|
+
stdoutTime: RealDate.now(),
|
|
101
|
+
stderrTime: RealDate.now(),
|
|
102
|
+
timer: 0
|
|
103
|
+
};
|
|
95
104
|
timers.set(id, timer);
|
|
96
105
|
}
|
|
97
106
|
let buffer = stdoutBuffer.get(id);
|
|
@@ -122,7 +131,11 @@ function createCustomConsole(defaultState) {
|
|
|
122
131
|
if (timer) {
|
|
123
132
|
timer.stderrTime = timer.stderrTime || RealDate.now();
|
|
124
133
|
} else {
|
|
125
|
-
timer = {
|
|
134
|
+
timer = {
|
|
135
|
+
stderrTime: RealDate.now(),
|
|
136
|
+
stdoutTime: RealDate.now(),
|
|
137
|
+
timer: 0
|
|
138
|
+
};
|
|
126
139
|
timers.set(id, timer);
|
|
127
140
|
}
|
|
128
141
|
let buffer = stderrBuffer.get(id);
|
|
@@ -135,7 +148,9 @@ function createCustomConsole(defaultState) {
|
|
|
135
148
|
Error.stackTraceLimit = limit + 6;
|
|
136
149
|
const stack = (_e = new Error("STACK_TRACE").stack) == null ? void 0 : _e.split("\n");
|
|
137
150
|
Error.stackTraceLimit = limit;
|
|
138
|
-
const isTrace = stack == null ? void 0 : stack.some(
|
|
151
|
+
const isTrace = stack == null ? void 0 : stack.some(
|
|
152
|
+
(line) => line.includes("at Console.trace")
|
|
153
|
+
);
|
|
139
154
|
if (isTrace) {
|
|
140
155
|
buffer.push([data, void 0]);
|
|
141
156
|
} else {
|
|
@@ -5,16 +5,16 @@ import '@vitest/runner/utils';
|
|
|
5
5
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
6
6
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
7
7
|
import '../vendor/env.bmJgw1qP.js';
|
|
8
|
-
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.
|
|
9
|
-
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.
|
|
10
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.
|
|
8
|
+
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.BPjl8cAZ.js';
|
|
9
|
+
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.BhYSDdTT.js';
|
|
10
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.-dbR4KUi.js';
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import util from 'node:util';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
14
|
import { isatty } from 'node:tty';
|
|
15
15
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
16
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
17
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
16
|
+
import { V as VitestIndex } from '../vendor/index.CQJ2m700.js';
|
|
17
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.uqZOEWuR.js';
|
|
18
18
|
import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
|
|
19
19
|
import 'std-env';
|
|
20
20
|
import 'chai';
|
|
@@ -22,18 +22,18 @@ import '../vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
|
22
22
|
import '@vitest/expect';
|
|
23
23
|
import '@vitest/snapshot';
|
|
24
24
|
import '@vitest/utils/error';
|
|
25
|
-
import '../vendor/tasks.
|
|
25
|
+
import '../vendor/tasks.DhVtQBtW.js';
|
|
26
26
|
import '@vitest/utils/source-map';
|
|
27
|
-
import '../vendor/base.
|
|
28
|
-
import '../vendor/date.
|
|
27
|
+
import '../vendor/base.CTYV4Gnz.js';
|
|
28
|
+
import '../vendor/date.W2xKR2qe.js';
|
|
29
29
|
import '@vitest/spy';
|
|
30
30
|
import '../path.js';
|
|
31
31
|
import 'node:url';
|
|
32
|
-
import '../vendor/rpc.
|
|
32
|
+
import '../vendor/rpc.BGx7q_k2.js';
|
|
33
33
|
import '../vendor/index.BpSiYbpB.js';
|
|
34
|
-
import '../vendor/benchmark.
|
|
35
|
-
import '../vendor/index.
|
|
36
|
-
import '../vendor/run-once.
|
|
34
|
+
import '../vendor/benchmark.CMp8QfyL.js';
|
|
35
|
+
import '../vendor/index.C9Thslzw.js';
|
|
36
|
+
import '../vendor/run-once.Db8Hgq9X.js';
|
|
37
37
|
|
|
38
38
|
let globalSetup = false;
|
|
39
39
|
async function setupGlobalEnv(config, { environment }, executor) {
|
|
@@ -43,10 +43,12 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
43
43
|
enumerable: false
|
|
44
44
|
});
|
|
45
45
|
const state = getWorkerState();
|
|
46
|
-
if (!state.config.snapshotOptions.snapshotEnvironment)
|
|
46
|
+
if (!state.config.snapshotOptions.snapshotEnvironment) {
|
|
47
47
|
state.config.snapshotOptions.snapshotEnvironment = await resolveSnapshotEnvironment(config, executor);
|
|
48
|
-
|
|
48
|
+
}
|
|
49
|
+
if (globalSetup) {
|
|
49
50
|
return;
|
|
51
|
+
}
|
|
50
52
|
globalSetup = true;
|
|
51
53
|
setupColors(createColors(isatty(1)));
|
|
52
54
|
if (environment.transformMode === "web") {
|
|
@@ -66,11 +68,12 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
66
68
|
installSourcemapsSupport({
|
|
67
69
|
getSourceMap: (source) => state.moduleCache.getSourceMap(source)
|
|
68
70
|
});
|
|
69
|
-
if (!config.disableConsoleIntercept)
|
|
71
|
+
if (!config.disableConsoleIntercept) {
|
|
70
72
|
await setupConsoleLogSpy();
|
|
73
|
+
}
|
|
71
74
|
}
|
|
72
75
|
async function setupConsoleLogSpy() {
|
|
73
|
-
const { createCustomConsole } = await import('./runtime-console.
|
|
76
|
+
const { createCustomConsole } = await import('./runtime-console.Ckl0vEQr.js');
|
|
74
77
|
globalThis.console = createCustomConsole();
|
|
75
78
|
}
|
|
76
79
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -92,8 +95,9 @@ async function run(files, config, environment, executor) {
|
|
|
92
95
|
const workerState = getWorkerState();
|
|
93
96
|
await setupGlobalEnv(config, environment, executor);
|
|
94
97
|
await startCoverageInsideWorker(config.coverage, executor);
|
|
95
|
-
if (config.chaiConfig)
|
|
98
|
+
if (config.chaiConfig) {
|
|
96
99
|
setupChaiConfig(config.chaiConfig);
|
|
100
|
+
}
|
|
97
101
|
const runner = await resolveTestRunner(config, executor);
|
|
98
102
|
workerState.onCancel.then((reason) => {
|
|
99
103
|
var _a;
|
|
@@ -102,23 +106,27 @@ async function run(files, config, environment, executor) {
|
|
|
102
106
|
});
|
|
103
107
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
104
108
|
workerState.durations.environment = performance.now();
|
|
105
|
-
await withEnv(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
await withEnv(
|
|
110
|
+
environment,
|
|
111
|
+
environment.options || config.environmentOptions || {},
|
|
112
|
+
async () => {
|
|
113
|
+
var _a, _b, _c, _d;
|
|
114
|
+
workerState.durations.environment = performance.now() - workerState.durations.environment;
|
|
115
|
+
for (const file of files) {
|
|
116
|
+
const isIsolatedThreads = config.pool === "threads" && (((_b = (_a = config.poolOptions) == null ? void 0 : _a.threads) == null ? void 0 : _b.isolate) ?? true);
|
|
117
|
+
const isIsolatedForks = config.pool === "forks" && (((_d = (_c = config.poolOptions) == null ? void 0 : _c.forks) == null ? void 0 : _d.isolate) ?? true);
|
|
118
|
+
if (isIsolatedThreads || isIsolatedForks) {
|
|
119
|
+
workerState.mockMap.clear();
|
|
120
|
+
resetModules(workerState.moduleCache, true);
|
|
121
|
+
}
|
|
122
|
+
workerState.filepath = file;
|
|
123
|
+
await startTests([file], runner);
|
|
124
|
+
vi.resetConfig();
|
|
125
|
+
vi.restoreAllMocks();
|
|
114
126
|
}
|
|
115
|
-
|
|
116
|
-
await startTests([file], runner);
|
|
117
|
-
vi.resetConfig();
|
|
118
|
-
vi.restoreAllMocks();
|
|
127
|
+
await stopCoverageInsideWorker(config.coverage, executor);
|
|
119
128
|
}
|
|
120
|
-
|
|
121
|
-
});
|
|
129
|
+
);
|
|
122
130
|
workerState.environmentTeardownRun = true;
|
|
123
131
|
}
|
|
124
132
|
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as createCLI } from './vendor/cac.
|
|
1
|
+
import { c as createCLI } from './vendor/cac.BcJW7n2j.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'picocolors';
|
|
5
|
-
import './vendor/base.
|
|
5
|
+
import './vendor/base.CTYV4Gnz.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import './vendor/constants.
|
|
7
|
+
import './vendor/constants.BWsVtsAj.js';
|
|
8
8
|
|
|
9
9
|
createCLI().parse();
|
package/dist/config.cjs
CHANGED
|
@@ -8,9 +8,25 @@ var _a$1;
|
|
|
8
8
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
9
9
|
isNode && process.platform === "win32";
|
|
10
10
|
|
|
11
|
+
const defaultBrowserPort = 63315;
|
|
12
|
+
const extraInlineDeps = [
|
|
13
|
+
/^(?!.*node_modules).*\.mjs$/,
|
|
14
|
+
/^(?!.*node_modules).*\.cjs\.js$/,
|
|
15
|
+
// Vite client
|
|
16
|
+
/vite\w*\/dist\/client\/env.mjs/,
|
|
17
|
+
// Nuxt
|
|
18
|
+
"@nuxt/test-utils"
|
|
19
|
+
];
|
|
20
|
+
|
|
11
21
|
var _a, _b;
|
|
12
22
|
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
13
|
-
const defaultExclude = [
|
|
23
|
+
const defaultExclude = [
|
|
24
|
+
"**/node_modules/**",
|
|
25
|
+
"**/dist/**",
|
|
26
|
+
"**/cypress/**",
|
|
27
|
+
"**/.{idea,git,cache,output,temp}/**",
|
|
28
|
+
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*"
|
|
29
|
+
];
|
|
14
30
|
const defaultCoverageExcludes = [
|
|
15
31
|
"coverage/**",
|
|
16
32
|
"dist/**",
|
|
@@ -38,11 +54,31 @@ const coverageConfigDefaults = {
|
|
|
38
54
|
reportsDirectory: "./coverage",
|
|
39
55
|
exclude: defaultCoverageExcludes,
|
|
40
56
|
reportOnFailure: false,
|
|
41
|
-
reporter: [
|
|
42
|
-
|
|
57
|
+
reporter: [
|
|
58
|
+
["text", {}],
|
|
59
|
+
["html", {}],
|
|
60
|
+
["clover", {}],
|
|
61
|
+
["json", {}]
|
|
62
|
+
],
|
|
63
|
+
extension: [
|
|
64
|
+
".js",
|
|
65
|
+
".cjs",
|
|
66
|
+
".mjs",
|
|
67
|
+
".ts",
|
|
68
|
+
".mts",
|
|
69
|
+
".cts",
|
|
70
|
+
".tsx",
|
|
71
|
+
".jsx",
|
|
72
|
+
".vue",
|
|
73
|
+
".svelte",
|
|
74
|
+
".marko"
|
|
75
|
+
],
|
|
43
76
|
allowExternal: false,
|
|
44
77
|
ignoreEmptyLines: true,
|
|
45
|
-
processingConcurrency: Math.min(
|
|
78
|
+
processingConcurrency: Math.min(
|
|
79
|
+
20,
|
|
80
|
+
((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length
|
|
81
|
+
)
|
|
46
82
|
};
|
|
47
83
|
const fakeTimersDefaults = {
|
|
48
84
|
loopLimit: 1e4,
|
|
@@ -69,13 +105,8 @@ const config = {
|
|
|
69
105
|
mockReset: false,
|
|
70
106
|
include: defaultInclude,
|
|
71
107
|
exclude: defaultExclude,
|
|
72
|
-
testTimeout: 5e3,
|
|
73
|
-
hookTimeout: 1e4,
|
|
74
108
|
teardownTimeout: 1e4,
|
|
75
|
-
forceRerunTriggers: [
|
|
76
|
-
"**/package.json/**",
|
|
77
|
-
"**/{vitest,vite}.config.*/**"
|
|
78
|
-
],
|
|
109
|
+
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
|
|
79
110
|
update: false,
|
|
80
111
|
reporters: [],
|
|
81
112
|
silent: false,
|
|
@@ -101,15 +132,6 @@ const config = {
|
|
|
101
132
|
};
|
|
102
133
|
const configDefaults = Object.freeze(config);
|
|
103
134
|
|
|
104
|
-
const extraInlineDeps = [
|
|
105
|
-
/^(?!.*node_modules).*\.mjs$/,
|
|
106
|
-
/^(?!.*node_modules).*\.cjs\.js$/,
|
|
107
|
-
// Vite client
|
|
108
|
-
/vite\w*\/dist\/client\/env.mjs/,
|
|
109
|
-
// Nuxt
|
|
110
|
-
"@nuxt/test-utils"
|
|
111
|
-
];
|
|
112
|
-
|
|
113
135
|
function defineConfig(config) {
|
|
114
136
|
return config;
|
|
115
137
|
}
|
|
@@ -126,6 +148,7 @@ Object.defineProperty(exports, "mergeConfig", {
|
|
|
126
148
|
});
|
|
127
149
|
exports.configDefaults = configDefaults;
|
|
128
150
|
exports.coverageConfigDefaults = coverageConfigDefaults;
|
|
151
|
+
exports.defaultBrowserPort = defaultBrowserPort;
|
|
129
152
|
exports.defaultExclude = defaultExclude;
|
|
130
153
|
exports.defaultInclude = defaultInclude;
|
|
131
154
|
exports.defineConfig = defineConfig;
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export {
|
|
2
|
+
export { aM as UserConfigExport, aL as UserConfigFn, aJ as UserConfigFnObject, aK as UserConfigFnPromise, aO as UserProjectConfigExport, aN as UserProjectConfigFn, K as UserWorkspaceConfig, aT as configDefaults, aW as coverageConfigDefaults, aS as defaultBrowserPort, aV as defaultExclude, aU as defaultInclude, aP as defineConfig, aQ as defineProject, aR as defineWorkspace, aX as extraInlineDeps } from './reporters-fiIq_dT9.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
package/dist/config.js
CHANGED
|
@@ -6,9 +6,25 @@ var _a$1;
|
|
|
6
6
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
7
7
|
isNode && process.platform === "win32";
|
|
8
8
|
|
|
9
|
+
const defaultBrowserPort = 63315;
|
|
10
|
+
const extraInlineDeps = [
|
|
11
|
+
/^(?!.*node_modules).*\.mjs$/,
|
|
12
|
+
/^(?!.*node_modules).*\.cjs\.js$/,
|
|
13
|
+
// Vite client
|
|
14
|
+
/vite\w*\/dist\/client\/env.mjs/,
|
|
15
|
+
// Nuxt
|
|
16
|
+
"@nuxt/test-utils"
|
|
17
|
+
];
|
|
18
|
+
|
|
9
19
|
var _a, _b;
|
|
10
20
|
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
11
|
-
const defaultExclude = [
|
|
21
|
+
const defaultExclude = [
|
|
22
|
+
"**/node_modules/**",
|
|
23
|
+
"**/dist/**",
|
|
24
|
+
"**/cypress/**",
|
|
25
|
+
"**/.{idea,git,cache,output,temp}/**",
|
|
26
|
+
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*"
|
|
27
|
+
];
|
|
12
28
|
const defaultCoverageExcludes = [
|
|
13
29
|
"coverage/**",
|
|
14
30
|
"dist/**",
|
|
@@ -36,11 +52,31 @@ const coverageConfigDefaults = {
|
|
|
36
52
|
reportsDirectory: "./coverage",
|
|
37
53
|
exclude: defaultCoverageExcludes,
|
|
38
54
|
reportOnFailure: false,
|
|
39
|
-
reporter: [
|
|
40
|
-
|
|
55
|
+
reporter: [
|
|
56
|
+
["text", {}],
|
|
57
|
+
["html", {}],
|
|
58
|
+
["clover", {}],
|
|
59
|
+
["json", {}]
|
|
60
|
+
],
|
|
61
|
+
extension: [
|
|
62
|
+
".js",
|
|
63
|
+
".cjs",
|
|
64
|
+
".mjs",
|
|
65
|
+
".ts",
|
|
66
|
+
".mts",
|
|
67
|
+
".cts",
|
|
68
|
+
".tsx",
|
|
69
|
+
".jsx",
|
|
70
|
+
".vue",
|
|
71
|
+
".svelte",
|
|
72
|
+
".marko"
|
|
73
|
+
],
|
|
41
74
|
allowExternal: false,
|
|
42
75
|
ignoreEmptyLines: true,
|
|
43
|
-
processingConcurrency: Math.min(
|
|
76
|
+
processingConcurrency: Math.min(
|
|
77
|
+
20,
|
|
78
|
+
((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length
|
|
79
|
+
)
|
|
44
80
|
};
|
|
45
81
|
const fakeTimersDefaults = {
|
|
46
82
|
loopLimit: 1e4,
|
|
@@ -67,13 +103,8 @@ const config = {
|
|
|
67
103
|
mockReset: false,
|
|
68
104
|
include: defaultInclude,
|
|
69
105
|
exclude: defaultExclude,
|
|
70
|
-
testTimeout: 5e3,
|
|
71
|
-
hookTimeout: 1e4,
|
|
72
106
|
teardownTimeout: 1e4,
|
|
73
|
-
forceRerunTriggers: [
|
|
74
|
-
"**/package.json/**",
|
|
75
|
-
"**/{vitest,vite}.config.*/**"
|
|
76
|
-
],
|
|
107
|
+
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
|
|
77
108
|
update: false,
|
|
78
109
|
reporters: [],
|
|
79
110
|
silent: false,
|
|
@@ -99,15 +130,6 @@ const config = {
|
|
|
99
130
|
};
|
|
100
131
|
const configDefaults = Object.freeze(config);
|
|
101
132
|
|
|
102
|
-
const extraInlineDeps = [
|
|
103
|
-
/^(?!.*node_modules).*\.mjs$/,
|
|
104
|
-
/^(?!.*node_modules).*\.cjs\.js$/,
|
|
105
|
-
// Vite client
|
|
106
|
-
/vite\w*\/dist\/client\/env.mjs/,
|
|
107
|
-
// Nuxt
|
|
108
|
-
"@nuxt/test-utils"
|
|
109
|
-
];
|
|
110
|
-
|
|
111
133
|
function defineConfig(config) {
|
|
112
134
|
return config;
|
|
113
135
|
}
|
|
@@ -118,4 +140,4 @@ function defineWorkspace(config) {
|
|
|
118
140
|
return config;
|
|
119
141
|
}
|
|
120
142
|
|
|
121
|
-
export { configDefaults, coverageConfigDefaults, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace, extraInlineDeps };
|
|
143
|
+
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace, extraInlineDeps };
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-
|
|
1
|
+
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-fiIq_dT9.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
@@ -129,7 +129,7 @@ declare class BaseCoverageProvider {
|
|
|
129
129
|
/**
|
|
130
130
|
* Check if current coverage is above configured thresholds and bump the thresholds if needed
|
|
131
131
|
*/
|
|
132
|
-
updateThresholds({ thresholds: allThresholds, perFile, configurationFile, onUpdate }: {
|
|
132
|
+
updateThresholds({ thresholds: allThresholds, perFile, configurationFile, onUpdate, }: {
|
|
133
133
|
thresholds: ResolvedThreshold[];
|
|
134
134
|
perFile?: boolean;
|
|
135
135
|
configurationFile: unknown;
|
|
@@ -138,7 +138,7 @@ declare class BaseCoverageProvider {
|
|
|
138
138
|
/**
|
|
139
139
|
* Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
|
|
140
140
|
*/
|
|
141
|
-
checkThresholds({ thresholds: allThresholds, perFile }: {
|
|
141
|
+
checkThresholds({ thresholds: allThresholds, perFile, }: {
|
|
142
142
|
thresholds: ResolvedThreshold[];
|
|
143
143
|
perFile?: boolean;
|
|
144
144
|
}): void;
|
|
@@ -147,7 +147,7 @@ declare class BaseCoverageProvider {
|
|
|
147
147
|
* where each threshold set holds their own coverage maps. Threshold set is either
|
|
148
148
|
* for specific files defined by glob pattern or global for all other files.
|
|
149
149
|
*/
|
|
150
|
-
resolveThresholds({ coverageMap, thresholds, createCoverageMap, root }: {
|
|
150
|
+
resolveThresholds({ coverageMap, thresholds, createCoverageMap, root, }: {
|
|
151
151
|
coverageMap: CoverageMap;
|
|
152
152
|
thresholds: NonNullable<BaseCoverageOptions['thresholds']>;
|
|
153
153
|
createCoverageMap: () => CoverageMap;
|