vitest 4.0.0-beta.8 → 4.0.0-beta.9
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 +5 -5
- package/dist/browser.js +4 -4
- package/dist/chunks/{runBaseTests.D6sfuWBM.js → base.CA5N8Af0.js} +55 -26
- package/dist/chunks/{benchmark.UW6Ezvxy.js → benchmark.CJUa-Hsa.js} +1 -1
- package/dist/chunks/{browser.d.DOMmqJQx.d.ts → browser.d.DtfyY9yS.d.ts} +1 -1
- package/dist/chunks/{cac.By1HvRIk.js → cac.Dt7e1TIu.js} +6 -24
- package/dist/chunks/{cli-api.C-JHgQgp.js → cli-api.eAzsLIxz.js} +41 -32
- package/dist/chunks/{config.d._GBBbReY.d.ts → config.d.DacWrqWe.d.ts} +1 -0
- package/dist/chunks/{console.B0quX7yH.js → console.7h5kHUIf.js} +1 -1
- package/dist/chunks/{coverage.DarITf6U.js → coverage.CDRAMTt7.js} +19 -50
- package/dist/chunks/{globals.lgsmH00r.js → globals.CJrTTbxC.js} +5 -6
- package/dist/chunks/{index.AzwzFtyi.js → index.BIP7prJq.js} +1 -1
- package/dist/chunks/{index.BuwjkI-q.js → index.BjKEiSn0.js} +1 -1
- package/dist/chunks/{index.AR8aAkCC.js → index.C832ioot.js} +5 -6
- package/dist/chunks/{moduleRunner.d.CX4DuqOx.d.ts → moduleRunner.d.DxTLreRD.d.ts} +4 -1
- package/dist/chunks/{node.BOqcT2jW.js → node.CyipiPvJ.js} +1 -1
- package/dist/chunks/{plugin.d.CHe6slQs.d.ts → plugin.d.CIk0YiKb.d.ts} +1 -1
- package/dist/chunks/{reporters.d.37tJQ2uV.d.ts → reporters.d.DmP-iHLr.d.ts} +9 -16
- package/dist/chunks/{index.CsFXYRkW.js → resolveSnapshotEnvironment.Bvv2zr69.js} +16 -21
- package/dist/chunks/{rpc.RpPylpp0.js → rpc.BKr6mtxz.js} +1 -1
- package/dist/chunks/{setup-common.hLGRxhC8.js → setup-common.B7I37Tji.js} +4 -4
- package/dist/chunks/{startModuleRunner.C8TW8zTN.js → startModuleRunner.BDRvKSdz.js} +7 -2
- package/dist/chunks/test.BAlBebnP.js +214 -0
- package/dist/chunks/{typechecker.DSo_maXz.js → typechecker.DB-fIMaH.js} +44 -1
- package/dist/chunks/{utils.C7__0Iv5.js → utils.D2R2NiOH.js} +1 -10
- package/dist/chunks/{vi.BfdOiD4j.js → vi.BB37KeLx.js} +16 -16
- package/dist/chunks/{vm.BHBje7cC.js → vm.CjLTDaST.js} +12 -7
- package/dist/chunks/{worker.d.DYlqbejz.d.ts → worker.d.B2r4Ln6p.d.ts} +1 -1
- package/dist/chunks/{worker.d.BKu8cnnX.d.ts → worker.d.DJ6qxO2w.d.ts} +1 -1
- package/dist/cli.js +3 -3
- package/dist/config.d.ts +7 -7
- package/dist/coverage.d.ts +5 -5
- package/dist/coverage.js +2 -2
- package/dist/index.d.ts +11 -12
- package/dist/index.js +5 -8
- package/dist/module-evaluator.d.ts +4 -3
- package/dist/module-evaluator.js +3 -3
- package/dist/module-runner.js +2 -2
- package/dist/node.d.ts +9 -10
- package/dist/node.js +8 -8
- package/dist/reporters.d.ts +5 -5
- package/dist/reporters.js +3 -3
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +11 -215
- package/dist/snapshot.js +2 -2
- package/dist/suite.js +2 -2
- package/dist/worker.js +2 -3
- package/dist/workers/forks.js +27 -4
- package/dist/workers/runVmTests.js +18 -19
- package/dist/workers/threads.js +27 -4
- package/dist/workers/vmForks.js +4 -4
- package/dist/workers/vmThreads.js +4 -4
- package/dist/workers.d.ts +3 -3
- package/dist/workers.js +26 -8
- package/package.json +10 -13
- package/dist/chunks/base.BXI97p6t.js +0 -39
package/dist/browser.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.
|
|
1
|
+
import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.DacWrqWe.js';
|
|
2
2
|
import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
|
|
3
3
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
4
|
-
import { V as VitestModuleRunner } from './chunks/moduleRunner.d.
|
|
4
|
+
import { V as VitestModuleRunner } from './chunks/moduleRunner.d.DxTLreRD.js';
|
|
5
5
|
export { collectTests, processError, startTests } from '@vitest/runner';
|
|
6
|
-
import * as
|
|
7
|
-
export {
|
|
6
|
+
import * as _vitest_spy from '@vitest/spy';
|
|
7
|
+
export { _vitest_spy as SpyModule };
|
|
8
8
|
export { LoupeOptions, ParsedStack, StringifyOptions, format, getSafeTimers, inspect, stringify } from '@vitest/utils';
|
|
9
9
|
export { TraceMap, originalPositionFor } from '@vitest/utils/source-map';
|
|
10
10
|
import '@vitest/pretty-format';
|
|
11
11
|
import '@vitest/snapshot';
|
|
12
12
|
import 'node:vm';
|
|
13
13
|
import 'vite/module-runner';
|
|
14
|
-
import './chunks/worker.d.
|
|
14
|
+
import './chunks/worker.d.B2r4Ln6p.js';
|
|
15
15
|
import './chunks/environment.d.2fYMoz3o.js';
|
|
16
16
|
import '@vitest/mocker';
|
|
17
17
|
import './chunks/mocker.d.BE_2ls6u.js';
|
package/dist/browser.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.
|
|
1
|
+
export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.B7I37Tji.js';
|
|
2
2
|
export { collectTests, processError, startTests } from '@vitest/runner';
|
|
3
|
-
import * as
|
|
4
|
-
export {
|
|
3
|
+
import * as spyModule from '@vitest/spy';
|
|
4
|
+
export { spyModule as SpyModule };
|
|
5
5
|
export { format, getSafeTimers, inspect, stringify } from '@vitest/utils';
|
|
6
6
|
export { TraceMap, originalPositionFor } from '@vitest/utils/source-map';
|
|
7
7
|
import './chunks/coverage.D_JHT54q.js';
|
|
8
8
|
import '@vitest/snapshot';
|
|
9
|
-
import './chunks/utils.
|
|
9
|
+
import './chunks/utils.D2R2NiOH.js';
|
|
@@ -1,40 +1,26 @@
|
|
|
1
|
+
import { runInThisContext } from 'node:vm';
|
|
2
|
+
import * as spyModule from '@vitest/spy';
|
|
3
|
+
import { EvaluatedModules } from 'vite/module-runner';
|
|
4
|
+
import { s as startVitestModuleRunner } from './startModuleRunner.BDRvKSdz.js';
|
|
1
5
|
import { performance } from 'node:perf_hooks';
|
|
2
6
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './
|
|
4
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.
|
|
5
|
-
import {
|
|
7
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './resolveSnapshotEnvironment.Bvv2zr69.js';
|
|
8
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.B7I37Tji.js';
|
|
9
|
+
import { g as globalExpect, v as vi } from './vi.BB37KeLx.js';
|
|
6
10
|
import { c as closeInspector } from './inspector.CvQD-Nie.js';
|
|
7
11
|
import { createRequire } from 'node:module';
|
|
8
12
|
import timers from 'node:timers';
|
|
9
13
|
import timersPromises from 'node:timers/promises';
|
|
10
14
|
import util from 'node:util';
|
|
11
15
|
import { KNOWN_ASSET_TYPES, getSafeTimers } from '@vitest/utils';
|
|
12
|
-
import {
|
|
13
|
-
import { g as getWorkerState, r as resetModules } from './utils.
|
|
14
|
-
import 'chai';
|
|
15
|
-
import 'node:path';
|
|
16
|
-
import '../path.js';
|
|
17
|
-
import 'node:url';
|
|
18
|
-
import './rpc.RpPylpp0.js';
|
|
19
|
-
import './index.Bgo3tNWt.js';
|
|
20
|
-
import './coverage.D_JHT54q.js';
|
|
21
|
-
import '@vitest/snapshot';
|
|
22
|
-
import '@vitest/expect';
|
|
23
|
-
import '@vitest/runner/utils';
|
|
24
|
-
import './_commonjsHelpers.BFTU3MAI.js';
|
|
25
|
-
import '@vitest/utils/error';
|
|
26
|
-
import '@vitest/spy';
|
|
27
|
-
import '@vitest/utils/source-map';
|
|
28
|
-
import './date.-jtEtIeV.js';
|
|
29
|
-
import './benchmark.UW6Ezvxy.js';
|
|
30
|
-
import 'expect-type';
|
|
31
|
-
import 'vite/module-runner';
|
|
16
|
+
import { i as index } from './index.C832ioot.js';
|
|
17
|
+
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './utils.D2R2NiOH.js';
|
|
32
18
|
|
|
33
19
|
// this should only be used in Node
|
|
34
20
|
let globalSetup = false;
|
|
35
21
|
async function setupGlobalEnv(config, { environment }, moduleRunner) {
|
|
36
22
|
await setupCommonEnv(config), Object.defineProperty(globalThis, "__vitest_index__", {
|
|
37
|
-
value:
|
|
23
|
+
value: index,
|
|
38
24
|
enumerable: false
|
|
39
25
|
});
|
|
40
26
|
const state = getWorkerState();
|
|
@@ -61,7 +47,7 @@ function resolveAsset(mod, url) {
|
|
|
61
47
|
mod.exports = url;
|
|
62
48
|
}
|
|
63
49
|
async function setupConsoleLogSpy() {
|
|
64
|
-
const { createCustomConsole } = await import('./console.
|
|
50
|
+
const { createCustomConsole } = await import('./console.7h5kHUIf.js');
|
|
65
51
|
globalThis.console = createCustomConsole();
|
|
66
52
|
}
|
|
67
53
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -96,4 +82,47 @@ async function run(method, files, config, environment, moduleRunner) {
|
|
|
96
82
|
}), workerState.environmentTeardownRun = true;
|
|
97
83
|
}
|
|
98
84
|
|
|
99
|
-
|
|
85
|
+
let _moduleRunner;
|
|
86
|
+
const evaluatedModules = new EvaluatedModules(), moduleExecutionInfo = /* @__PURE__ */ new Map();
|
|
87
|
+
function startModuleRunner(options) {
|
|
88
|
+
return _moduleRunner || (_moduleRunner = startVitestModuleRunner(options), _moduleRunner);
|
|
89
|
+
}
|
|
90
|
+
async function runBaseTests(method, state) {
|
|
91
|
+
const { ctx } = state;
|
|
92
|
+
if (state.evaluatedModules = evaluatedModules, state.moduleExecutionInfo = moduleExecutionInfo, provideWorkerState(globalThis, state), ctx.invalidates) ctx.invalidates.forEach((filepath) => {
|
|
93
|
+
const modules = state.evaluatedModules.fileToModulesMap.get(filepath) || [];
|
|
94
|
+
modules.forEach((module) => {
|
|
95
|
+
state.evaluatedModules.invalidateModule(module);
|
|
96
|
+
});
|
|
97
|
+
// evaluatedModules.delete(fsPath)
|
|
98
|
+
// evaluatedModules.delete(`mock:${fsPath}`)
|
|
99
|
+
});
|
|
100
|
+
ctx.files.forEach((i) => {
|
|
101
|
+
const filepath = typeof i === "string" ? i : i.filepath, modules = state.evaluatedModules.fileToModulesMap.get(filepath) || [];
|
|
102
|
+
modules.forEach((module) => {
|
|
103
|
+
state.evaluatedModules.invalidateModule(module);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
const executor = startModuleRunner({
|
|
107
|
+
state,
|
|
108
|
+
evaluatedModules: state.evaluatedModules,
|
|
109
|
+
spyModule
|
|
110
|
+
}), fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
111
|
+
filepath: f,
|
|
112
|
+
testLocations: void 0
|
|
113
|
+
} : f);
|
|
114
|
+
if (ctx.config.serializedDefines) try {
|
|
115
|
+
runInThisContext(`(() =>{\n${ctx.config.serializedDefines}})()`, {
|
|
116
|
+
lineOffset: 1,
|
|
117
|
+
filename: "virtual:load-defines.js"
|
|
118
|
+
});
|
|
119
|
+
} catch (error) {
|
|
120
|
+
throw new Error(`Failed to load custom "defines": ${error.message}`);
|
|
121
|
+
}
|
|
122
|
+
await run(method, fileSpecs, ctx.config, {
|
|
123
|
+
environment: state.environment,
|
|
124
|
+
options: ctx.environment.options
|
|
125
|
+
}, executor);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { runBaseTests as r };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentSuite } from '@vitest/runner';
|
|
2
2
|
import { createChainable } from '@vitest/runner/utils';
|
|
3
3
|
import { noop } from '@vitest/utils';
|
|
4
|
-
import { g as getWorkerState } from './utils.
|
|
4
|
+
import { g as getWorkerState } from './utils.D2R2NiOH.js';
|
|
5
5
|
|
|
6
6
|
const benchFns = /* @__PURE__ */ new WeakMap(), benchOptsMap = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getBenchOptions(key) {
|
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { normalize } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import { a as defaultPort, d as defaultBrowserPort } from './constants.D_Q9UYh-.js';
|
|
6
|
-
import { R as ReportersMap } from './index.
|
|
6
|
+
import { R as ReportersMap } from './index.BIP7prJq.js';
|
|
7
7
|
|
|
8
8
|
function toArr(any) {
|
|
9
9
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
|
|
|
619
619
|
|
|
620
620
|
const cac = (name = "") => new CAC(name);
|
|
621
621
|
|
|
622
|
-
var version = "4.0.0-beta.
|
|
622
|
+
var version = "4.0.0-beta.9";
|
|
623
623
|
|
|
624
624
|
const apiConfig = (port) => ({
|
|
625
625
|
port: {
|
|
@@ -639,10 +639,6 @@ const apiConfig = (port) => ({
|
|
|
639
639
|
description: "Maximum number or percentage of threads to run tests in",
|
|
640
640
|
argument: "<workers>"
|
|
641
641
|
},
|
|
642
|
-
minThreads: {
|
|
643
|
-
description: "Minimum number or percentage of threads to run tests in",
|
|
644
|
-
argument: "<workers>"
|
|
645
|
-
},
|
|
646
642
|
useAtomics: { description: "Use Atomics to synchronize threads. This can improve performance in some cases, but might cause segfault in older Node versions (default: `false`)" },
|
|
647
643
|
execArgv: null
|
|
648
644
|
}, poolForksCommands = {
|
|
@@ -652,10 +648,6 @@ const apiConfig = (port) => ({
|
|
|
652
648
|
description: "Maximum number or percentage of processes to run tests in",
|
|
653
649
|
argument: "<workers>"
|
|
654
650
|
},
|
|
655
|
-
minForks: {
|
|
656
|
-
description: "Minimum number or percentage of processes to run tests in",
|
|
657
|
-
argument: "<workers>"
|
|
658
|
-
},
|
|
659
651
|
execArgv: null
|
|
660
652
|
};
|
|
661
653
|
function watermarkTransform(value) {
|
|
@@ -930,10 +922,6 @@ const cliOptionsConfig = {
|
|
|
930
922
|
description: "Maximum number or percentage of workers to run tests in",
|
|
931
923
|
argument: "<workers>"
|
|
932
924
|
},
|
|
933
|
-
minWorkers: {
|
|
934
|
-
description: "Minimum number or percentage of workers to run tests in",
|
|
935
|
-
argument: "<workers>"
|
|
936
|
-
},
|
|
937
925
|
environment: {
|
|
938
926
|
description: "Specify runner environment, if not running in the browser (default: `node`)",
|
|
939
927
|
argument: "<name>",
|
|
@@ -1332,13 +1320,10 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
1332
1320
|
}
|
|
1333
1321
|
async function start(mode, cliFilters, options) {
|
|
1334
1322
|
try {
|
|
1335
|
-
|
|
1336
|
-
} catch {}
|
|
1337
|
-
try {
|
|
1338
|
-
const { startVitest } = await import('./cli-api.C-JHgQgp.js').then(function (n) { return n.j; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1323
|
+
const { startVitest } = await import('./cli-api.eAzsLIxz.js').then(function (n) { return n.j; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1339
1324
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
1340
1325
|
} catch (e) {
|
|
1341
|
-
const { errorBanner } = await import('./index.
|
|
1326
|
+
const { errorBanner } = await import('./index.BIP7prJq.js').then(function (n) { return n.u; });
|
|
1342
1327
|
if (console.error(`\n${errorBanner("Startup Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
|
|
1343
1328
|
process.exit();
|
|
1344
1329
|
}
|
|
@@ -1350,10 +1335,7 @@ async function init(project) {
|
|
|
1350
1335
|
}
|
|
1351
1336
|
async function collect(mode, cliFilters, options) {
|
|
1352
1337
|
try {
|
|
1353
|
-
|
|
1354
|
-
} catch {}
|
|
1355
|
-
try {
|
|
1356
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.C-JHgQgp.js').then(function (n) { return n.j; }), ctx = await prepareVitest(mode, {
|
|
1338
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.eAzsLIxz.js').then(function (n) { return n.j; }), ctx = await prepareVitest(mode, {
|
|
1357
1339
|
...normalizeCliOptions(cliFilters, options),
|
|
1358
1340
|
watch: false,
|
|
1359
1341
|
run: true
|
|
@@ -1371,7 +1353,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1371
1353
|
}
|
|
1372
1354
|
await ctx.close();
|
|
1373
1355
|
} catch (e) {
|
|
1374
|
-
const { errorBanner } = await import('./index.
|
|
1356
|
+
const { errorBanner } = await import('./index.BIP7prJq.js').then(function (n) { return n.u; });
|
|
1375
1357
|
if (console.error(`\n${errorBanner("Collect Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
|
|
1376
1358
|
process.exit();
|
|
1377
1359
|
}
|
|
@@ -10,9 +10,9 @@ import { A as API_PATH, c as configFiles, d as defaultBrowserPort, a as defaultP
|
|
|
10
10
|
import nodeos__default, { tmpdir } from 'node:os';
|
|
11
11
|
import { generateHash as generateHash$1, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, hasFailed, getTasks, getTests } from '@vitest/runner/utils';
|
|
12
12
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
13
|
-
import { v as version$1 } from './cac.
|
|
13
|
+
import { v as version$1 } from './cac.Dt7e1TIu.js';
|
|
14
14
|
import { c as createBirpc } from './index.Bgo3tNWt.js';
|
|
15
|
-
import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, B as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.
|
|
15
|
+
import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, B as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.BIP7prJq.js';
|
|
16
16
|
import require$$0$3 from 'events';
|
|
17
17
|
import require$$1$1 from 'https';
|
|
18
18
|
import require$$2 from 'http';
|
|
@@ -26,8 +26,8 @@ import require$$0$1 from 'buffer';
|
|
|
26
26
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
27
27
|
import crypto, { createHash } from 'node:crypto';
|
|
28
28
|
import { distDir, rootDir } from '../path.js';
|
|
29
|
-
import { h as hash, d as createFetchModuleFunction, n as normalizeResolvedIdToUrl, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, e as isBrowserEnabled, r as resolveConfig, f as groupBy, j as getCoverageProvider, k as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.
|
|
30
|
-
import { b as ancestor, c as convertTasksToEvents } from './typechecker.
|
|
29
|
+
import { h as hash, d as createFetchModuleFunction, n as normalizeResolvedIdToUrl, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, e as isBrowserEnabled, r as resolveConfig, f as groupBy, j as getCoverageProvider, k as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.CDRAMTt7.js';
|
|
30
|
+
import { b as ancestor, c as createDefinesScript, d as convertTasksToEvents } from './typechecker.DB-fIMaH.js';
|
|
31
31
|
import { TraceMap, originalPositionFor, parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
32
32
|
import createDebug from 'debug';
|
|
33
33
|
import { VitestModuleEvaluator } from '#module-evaluator';
|
|
@@ -45,7 +45,7 @@ import { hoistMocksPlugin, automockPlugin } from '@vitest/mocker/node';
|
|
|
45
45
|
import { c as configDefaults } from './defaults.CXFFjsi8.js';
|
|
46
46
|
import { f as findNearestPackageData } from './resolver.Bx6lE0iq.js';
|
|
47
47
|
import * as esModuleLexer from 'es-module-lexer';
|
|
48
|
-
import { a as BenchmarkReportsMap } from './index.
|
|
48
|
+
import { a as BenchmarkReportsMap } from './index.BjKEiSn0.js';
|
|
49
49
|
import assert$1 from 'node:assert';
|
|
50
50
|
import { serializeError as serializeError$1 } from '@vitest/utils/error';
|
|
51
51
|
import readline from 'node:readline';
|
|
@@ -5866,8 +5866,8 @@ class VitestPackageInstaller {
|
|
|
5866
5866
|
}
|
|
5867
5867
|
}
|
|
5868
5868
|
|
|
5869
|
-
function serializeConfig(
|
|
5870
|
-
const optimizer = config.deps?.optimizer || {}, poolOptions = config.poolOptions, isolate = viteConfig?.test?.isolate;
|
|
5869
|
+
function serializeConfig(project) {
|
|
5870
|
+
const { config, globalConfig } = project, viteConfig = project._vite?.config, optimizer = config.deps?.optimizer || {}, poolOptions = config.poolOptions, isolate = viteConfig?.test?.isolate;
|
|
5871
5871
|
return {
|
|
5872
5872
|
environmentOptions: config.environmentOptions,
|
|
5873
5873
|
mode: config.mode,
|
|
@@ -5913,15 +5913,15 @@ function serializeConfig(config, coreConfig, viteConfig) {
|
|
|
5913
5913
|
fakeTimers: config.fakeTimers,
|
|
5914
5914
|
poolOptions: {
|
|
5915
5915
|
forks: {
|
|
5916
|
-
singleFork: poolOptions?.forks?.singleFork ??
|
|
5917
|
-
isolate: poolOptions?.forks?.isolate ?? isolate ??
|
|
5916
|
+
singleFork: poolOptions?.forks?.singleFork ?? globalConfig.poolOptions?.forks?.singleFork ?? false,
|
|
5917
|
+
isolate: poolOptions?.forks?.isolate ?? isolate ?? globalConfig.poolOptions?.forks?.isolate ?? true
|
|
5918
5918
|
},
|
|
5919
5919
|
threads: {
|
|
5920
|
-
singleThread: poolOptions?.threads?.singleThread ??
|
|
5921
|
-
isolate: poolOptions?.threads?.isolate ?? isolate ??
|
|
5920
|
+
singleThread: poolOptions?.threads?.singleThread ?? globalConfig.poolOptions?.threads?.singleThread ?? false,
|
|
5921
|
+
isolate: poolOptions?.threads?.isolate ?? isolate ?? globalConfig.poolOptions?.threads?.isolate ?? true
|
|
5922
5922
|
},
|
|
5923
|
-
vmThreads: { singleThread: poolOptions?.vmThreads?.singleThread ??
|
|
5924
|
-
vmForks: { singleFork: poolOptions?.vmForks?.singleFork ??
|
|
5923
|
+
vmThreads: { singleThread: poolOptions?.vmThreads?.singleThread ?? globalConfig.poolOptions?.vmThreads?.singleThread ?? false },
|
|
5924
|
+
vmForks: { singleFork: poolOptions?.vmForks?.singleFork ?? globalConfig.poolOptions?.vmForks?.singleFork ?? false }
|
|
5925
5925
|
},
|
|
5926
5926
|
deps: {
|
|
5927
5927
|
web: config.deps.web || {},
|
|
@@ -5933,22 +5933,22 @@ function serializeConfig(config, coreConfig, viteConfig) {
|
|
|
5933
5933
|
},
|
|
5934
5934
|
snapshotOptions: {
|
|
5935
5935
|
snapshotEnvironment: void 0,
|
|
5936
|
-
updateSnapshot:
|
|
5937
|
-
snapshotFormat: { ...
|
|
5938
|
-
expand: config.snapshotOptions.expand ??
|
|
5936
|
+
updateSnapshot: globalConfig.snapshotOptions.updateSnapshot,
|
|
5937
|
+
snapshotFormat: { ...globalConfig.snapshotOptions.snapshotFormat },
|
|
5938
|
+
expand: config.snapshotOptions.expand ?? globalConfig.snapshotOptions.expand
|
|
5939
5939
|
},
|
|
5940
5940
|
sequence: {
|
|
5941
|
-
shuffle:
|
|
5942
|
-
concurrent:
|
|
5943
|
-
seed:
|
|
5944
|
-
hooks:
|
|
5945
|
-
setupFiles:
|
|
5941
|
+
shuffle: globalConfig.sequence.shuffle,
|
|
5942
|
+
concurrent: globalConfig.sequence.concurrent,
|
|
5943
|
+
seed: globalConfig.sequence.seed,
|
|
5944
|
+
hooks: globalConfig.sequence.hooks,
|
|
5945
|
+
setupFiles: globalConfig.sequence.setupFiles
|
|
5946
5946
|
},
|
|
5947
|
-
inspect:
|
|
5948
|
-
inspectBrk:
|
|
5949
|
-
inspector:
|
|
5947
|
+
inspect: globalConfig.inspect,
|
|
5948
|
+
inspectBrk: globalConfig.inspectBrk,
|
|
5949
|
+
inspector: globalConfig.inspector,
|
|
5950
5950
|
watch: config.watch,
|
|
5951
|
-
includeTaskLocation: config.includeTaskLocation ??
|
|
5951
|
+
includeTaskLocation: config.includeTaskLocation ?? globalConfig.includeTaskLocation,
|
|
5952
5952
|
env: {
|
|
5953
5953
|
...viteConfig?.env,
|
|
5954
5954
|
...config.env
|
|
@@ -5968,8 +5968,9 @@ function serializeConfig(config, coreConfig, viteConfig) {
|
|
|
5968
5968
|
};
|
|
5969
5969
|
})(config.browser),
|
|
5970
5970
|
standalone: config.standalone,
|
|
5971
|
-
printConsoleTrace: config.printConsoleTrace ??
|
|
5972
|
-
benchmark: config.benchmark && { includeSamples: config.benchmark.includeSamples }
|
|
5971
|
+
printConsoleTrace: config.printConsoleTrace ?? globalConfig.printConsoleTrace,
|
|
5972
|
+
benchmark: config.benchmark && { includeSamples: config.benchmark.includeSamples },
|
|
5973
|
+
serializedDefines: config.browser.enabled ? "" : project._serializedDefines || ""
|
|
5973
5974
|
};
|
|
5974
5975
|
}
|
|
5975
5976
|
|
|
@@ -5999,6 +6000,7 @@ async function loadGlobalSetupFile(file, runner) {
|
|
|
5999
6000
|
function CoverageTransform(ctx) {
|
|
6000
6001
|
return {
|
|
6001
6002
|
name: "vitest:coverage-transform",
|
|
6003
|
+
enforce: "post",
|
|
6002
6004
|
transform(srcCode, id) {
|
|
6003
6005
|
return ctx.coverageProvider?.onFileTransform?.(srcCode, id, this);
|
|
6004
6006
|
}
|
|
@@ -7156,6 +7158,7 @@ class TestProject {
|
|
|
7156
7158
|
/** @internal */ _vite;
|
|
7157
7159
|
/** @internal */ _hash;
|
|
7158
7160
|
/** @internal */ _resolver;
|
|
7161
|
+
/** @internal */ _serializedDefines;
|
|
7159
7162
|
/** @inetrnal */ testFilesList = null;
|
|
7160
7163
|
runner;
|
|
7161
7164
|
closingPromise;
|
|
@@ -7435,13 +7438,13 @@ class TestProject {
|
|
|
7435
7438
|
// type is very strict here, so we cast it to any
|
|
7436
7439
|
this.provide(providedKey, this.config.provide[providedKey]);
|
|
7437
7440
|
}
|
|
7438
|
-
this.closingPromise = void 0, this._resolver = new VitestResolver(server.config.cacheDir, this._config), this._vite = server;
|
|
7441
|
+
this.closingPromise = void 0, this._resolver = new VitestResolver(server.config.cacheDir, this._config), this._vite = server, this._serializedDefines = createDefinesScript(server.config.define);
|
|
7439
7442
|
const environment = server.environments.__vitest__;
|
|
7440
7443
|
this.runner = new ServerModuleRunner(environment, this._resolver, this._config);
|
|
7441
7444
|
}
|
|
7442
7445
|
_serializeOverriddenConfig() {
|
|
7443
7446
|
// TODO: serialize the config _once_ or when needed
|
|
7444
|
-
const config = serializeConfig(this
|
|
7447
|
+
const config = serializeConfig(this);
|
|
7445
7448
|
return this.vitest.configOverride ? deepMerge(config, this.vitest.configOverride) : config;
|
|
7446
7449
|
}
|
|
7447
7450
|
async clearTmpDir() {
|
|
@@ -7467,12 +7470,12 @@ class TestProject {
|
|
|
7467
7470
|
/** @internal */
|
|
7468
7471
|
static _createBasicProject(vitest) {
|
|
7469
7472
|
const project = new TestProject(vitest);
|
|
7470
|
-
return project.runner = vitest.runner, project._vite = vitest.vite, project._config = vitest.config, project._resolver = vitest._resolver, project._setHash(), project._provideObject(vitest.config.provide), project;
|
|
7473
|
+
return project.runner = vitest.runner, project._vite = vitest.vite, project._config = vitest.config, project._resolver = vitest._resolver, project._serializedDefines = createDefinesScript(vitest.vite.config.define), project._setHash(), project._provideObject(vitest.config.provide), project;
|
|
7471
7474
|
}
|
|
7472
7475
|
/** @internal */
|
|
7473
7476
|
static _cloneBrowserProject(parent, config) {
|
|
7474
7477
|
const clone = new TestProject(parent.vitest);
|
|
7475
|
-
return clone.runner = parent.runner, clone._vite = parent._vite, clone._resolver = parent._resolver, clone._config = config, clone._setHash(), clone._parent = parent, clone._provideObject(config.provide), clone;
|
|
7478
|
+
return clone.runner = parent.runner, clone._vite = parent._vite, clone._resolver = parent._resolver, clone._config = config, clone._setHash(), clone._parent = parent, clone._serializedDefines = parent._serializedDefines, clone._provideObject(config.provide), clone;
|
|
7476
7479
|
}
|
|
7477
7480
|
}
|
|
7478
7481
|
function deduped(cb) {
|
|
@@ -8871,7 +8874,7 @@ class TestRun {
|
|
|
8871
8874
|
// specification won't have the File task if they were filtered by the --shard command
|
|
8872
8875
|
const modules = specifications.map((spec) => spec.testModule).filter((s) => s != null), state = this.vitest.isCancelling ? "interrupted" : this.hasFailed(modules) ? "failed" : "passed";
|
|
8873
8876
|
if (state !== "passed") process.exitCode = 1;
|
|
8874
|
-
this.vitest.report("onTestRunEnd", modules, [...errors], state);
|
|
8877
|
+
await this.vitest.report("onTestRunEnd", modules, [...errors], state);
|
|
8875
8878
|
}
|
|
8876
8879
|
hasFailed(modules) {
|
|
8877
8880
|
return modules.length ? modules.some((m) => !m.ok()) : !this.vitest.config.passWithNoTests;
|
|
@@ -9607,6 +9610,12 @@ class Vitest {
|
|
|
9607
9610
|
else this.configOverride.testNamePattern = pattern ? new RegExp(pattern) : void 0;
|
|
9608
9611
|
}
|
|
9609
9612
|
/**
|
|
9613
|
+
* Returns the regexp used for the global test name pattern.
|
|
9614
|
+
*/
|
|
9615
|
+
getGlobalTestNamePattern() {
|
|
9616
|
+
return this.configOverride.testNamePattern == null ? this.config.testNamePattern : this.configOverride.testNamePattern;
|
|
9617
|
+
}
|
|
9618
|
+
/**
|
|
9610
9619
|
* Resets the global test name pattern. This method doesn't run any tests.
|
|
9611
9620
|
*/
|
|
9612
9621
|
resetGlobalTestNamePattern() {
|
|
@@ -4,7 +4,7 @@ import { Writable } from 'node:stream';
|
|
|
4
4
|
import { getSafeTimers } from '@vitest/utils';
|
|
5
5
|
import c from 'tinyrainbow';
|
|
6
6
|
import { R as RealDate } from './date.-jtEtIeV.js';
|
|
7
|
-
import { g as getWorkerState } from './utils.
|
|
7
|
+
import { g as getWorkerState } from './utils.D2R2NiOH.js';
|
|
8
8
|
|
|
9
9
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
10
10
|
function getTaskIdByStack(root) {
|
|
@@ -23,7 +23,7 @@ import { isatty } from 'node:tty';
|
|
|
23
23
|
import EventEmitter from 'node:events';
|
|
24
24
|
import { c as createBirpc } from './index.Bgo3tNWt.js';
|
|
25
25
|
import Tinypool$1, { Tinypool } from 'tinypool';
|
|
26
|
-
import { w as wrapSerializableConfig, a as Typechecker } from './typechecker.
|
|
26
|
+
import { w as wrapSerializableConfig, a as Typechecker } from './typechecker.DB-fIMaH.js';
|
|
27
27
|
import { MessageChannel } from 'node:worker_threads';
|
|
28
28
|
import { hasFailed } from '@vitest/runner/utils';
|
|
29
29
|
import { rootDir } from '../path.js';
|
|
@@ -2685,8 +2685,8 @@ function createChildProcessChannel$1(project, collect = false) {
|
|
|
2685
2685
|
};
|
|
2686
2686
|
return channel;
|
|
2687
2687
|
}
|
|
2688
|
-
function createForksPool(vitest, { execArgv, env }) {
|
|
2689
|
-
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), poolOptions = vitest.config.poolOptions?.forks ?? {}, maxThreads = poolOptions.maxForks ?? vitest.config.maxWorkers ??
|
|
2688
|
+
function createForksPool(vitest, { execArgv, env }, specifications) {
|
|
2689
|
+
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), recommendedCount = vitest.config.watch ? threadsCount : Math.min(threadsCount, specifications.length), poolOptions = vitest.config.poolOptions?.forks ?? {}, maxThreads = poolOptions.maxForks ?? vitest.config.maxWorkers ?? recommendedCount, minThreads = vitest.config.watch ? Math.min(recommendedCount, maxThreads) : 0, worker = resolve(vitest.distPath, "workers/forks.js"), options = {
|
|
2690
2690
|
runtime: "child_process",
|
|
2691
2691
|
filename: resolve(vitest.distPath, "worker.js"),
|
|
2692
2692
|
teardown: "teardown",
|
|
@@ -2792,8 +2792,8 @@ function createWorkerChannel$1(project, collect) {
|
|
|
2792
2792
|
onClose
|
|
2793
2793
|
};
|
|
2794
2794
|
}
|
|
2795
|
-
function createThreadsPool(vitest, { execArgv, env }) {
|
|
2796
|
-
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), poolOptions = vitest.config.poolOptions?.threads ?? {}, maxThreads = poolOptions.maxThreads ?? vitest.config.maxWorkers ??
|
|
2795
|
+
function createThreadsPool(vitest, { execArgv, env }, specifications) {
|
|
2796
|
+
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), recommendedCount = vitest.config.watch ? threadsCount : Math.min(threadsCount, specifications.length), poolOptions = vitest.config.poolOptions?.threads ?? {}, maxThreads = poolOptions.maxThreads ?? vitest.config.maxWorkers ?? recommendedCount, minThreads = vitest.config.watch ? Math.min(recommendedCount, maxThreads) : 0, worker = resolve(vitest.distPath, "workers/threads.js"), options = {
|
|
2797
2797
|
filename: resolve(vitest.distPath, "worker.js"),
|
|
2798
2798
|
teardown: "teardown",
|
|
2799
2799
|
useAtomics: poolOptions.useAtomics ?? false,
|
|
@@ -3051,8 +3051,8 @@ function createChildProcessChannel(project, collect) {
|
|
|
3051
3051
|
};
|
|
3052
3052
|
return { channel };
|
|
3053
3053
|
}
|
|
3054
|
-
function createVmForksPool(vitest, { execArgv, env }) {
|
|
3055
|
-
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), poolOptions = vitest.config.poolOptions?.vmForks ?? {}, maxThreads = poolOptions.maxForks ?? vitest.config.maxWorkers ??
|
|
3054
|
+
function createVmForksPool(vitest, { execArgv, env }, specifications) {
|
|
3055
|
+
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), recommendedCount = vitest.config.watch ? threadsCount : Math.min(threadsCount, specifications.length), poolOptions = vitest.config.poolOptions?.vmForks ?? {}, maxThreads = poolOptions.maxForks ?? vitest.config.maxWorkers ?? recommendedCount, minThreads = vitest.config.watch ? Math.min(recommendedCount, maxThreads) : 0, worker = resolve(vitest.distPath, "workers/vmForks.js"), options = {
|
|
3056
3056
|
runtime: "child_process",
|
|
3057
3057
|
filename: resolve(vitest.distPath, "worker.js"),
|
|
3058
3058
|
maxThreads,
|
|
@@ -3146,8 +3146,8 @@ function createWorkerChannel(project, collect) {
|
|
|
3146
3146
|
onClose
|
|
3147
3147
|
};
|
|
3148
3148
|
}
|
|
3149
|
-
function createVmThreadsPool(vitest, { execArgv, env }) {
|
|
3150
|
-
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), poolOptions = vitest.config.poolOptions?.vmThreads ?? {}, maxThreads = poolOptions.maxThreads ?? vitest.config.maxWorkers ??
|
|
3149
|
+
function createVmThreadsPool(vitest, { execArgv, env }, specifications) {
|
|
3150
|
+
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length, threadsCount = vitest.config.watch ? Math.max(Math.floor(numCpus / 2), 1) : Math.max(numCpus - 1, 1), recommendedCount = vitest.config.watch ? threadsCount : Math.min(threadsCount, specifications.length), poolOptions = vitest.config.poolOptions?.vmThreads ?? {}, maxThreads = poolOptions.maxThreads ?? vitest.config.maxWorkers ?? recommendedCount, minThreads = vitest.config.watch ? Math.min(recommendedCount, maxThreads) : 0, worker = resolve(vitest.distPath, "workers/vmThreads.js"), options = {
|
|
3151
3151
|
filename: resolve(vitest.distPath, "worker.js"),
|
|
3152
3152
|
useAtomics: poolOptions.useAtomics ?? false,
|
|
3153
3153
|
maxThreads,
|
|
@@ -3294,10 +3294,10 @@ function createPool(ctx) {
|
|
|
3294
3294
|
});
|
|
3295
3295
|
}
|
|
3296
3296
|
const groupedSpecifications = {}, groups = /* @__PURE__ */ new Set(), factories = {
|
|
3297
|
-
vmThreads: () => createVmThreadsPool(ctx, options),
|
|
3298
|
-
vmForks: () => createVmForksPool(ctx, options),
|
|
3299
|
-
threads: () => createThreadsPool(ctx, options),
|
|
3300
|
-
forks: () => createForksPool(ctx, options),
|
|
3297
|
+
vmThreads: (specs) => createVmThreadsPool(ctx, options, specs),
|
|
3298
|
+
vmForks: (specs) => createVmForksPool(ctx, options, specs),
|
|
3299
|
+
threads: (specs) => createThreadsPool(ctx, options, specs),
|
|
3300
|
+
forks: (specs) => createForksPool(ctx, options, specs),
|
|
3301
3301
|
typescript: () => createTypecheckPool(ctx)
|
|
3302
3302
|
};
|
|
3303
3303
|
for (const spec of files) {
|
|
@@ -3332,7 +3332,7 @@ function createPool(ctx) {
|
|
|
3332
3332
|
const specs = await sortSpecs(files);
|
|
3333
3333
|
if (pool in factories) {
|
|
3334
3334
|
const factory = factories[pool];
|
|
3335
|
-
return pools[pool] ??= factory(), pools[pool][method](specs, invalidate);
|
|
3335
|
+
return pools[pool] ??= factory(specs), pools[pool][method](specs, invalidate);
|
|
3336
3336
|
}
|
|
3337
3337
|
if (pool === "browser") return pools.browser ??= await getBrowserPool(), pools.browser[method](specs, invalidate);
|
|
3338
3338
|
const poolHandler = await getCustomPool(pool);
|
|
@@ -3463,8 +3463,9 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
3463
3463
|
if (resolved.standalone && !resolved.watch) throw new Error(`Vitest standalone mode requires --watch`);
|
|
3464
3464
|
if (resolved.mergeReports && resolved.watch) throw new Error(`Cannot merge reports with --watch enabled`);
|
|
3465
3465
|
if (resolved.maxWorkers) resolved.maxWorkers = resolveInlineWorkerOption(resolved.maxWorkers);
|
|
3466
|
-
if (resolved.
|
|
3467
|
-
|
|
3466
|
+
if (resolved.fileParallelism ??= mode !== "benchmark", !resolved.fileParallelism)
|
|
3467
|
+
// ignore user config, parallelism cannot be implemented without limiting workers
|
|
3468
|
+
resolved.maxWorkers = 1;
|
|
3468
3469
|
if (resolved.maxConcurrency === 0) logger.console.warn(c.yellow(`The option "maxConcurrency" cannot be set to 0. Using default value ${configDefaults.maxConcurrency} instead.`)), resolved.maxConcurrency = configDefaults.maxConcurrency;
|
|
3469
3470
|
if (resolved.inspect || resolved.inspectBrk) {
|
|
3470
3471
|
const isSingleThread = resolved.pool === "threads" && resolved.poolOptions?.threads?.singleThread, isSingleFork = resolved.pool === "forks" && resolved.poolOptions?.forks?.singleFork;
|
|
@@ -3553,17 +3554,6 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
3553
3554
|
maxThreads: Number.parseInt(process.env.VITEST_MAX_THREADS)
|
|
3554
3555
|
}
|
|
3555
3556
|
};
|
|
3556
|
-
if (process.env.VITEST_MIN_THREADS) resolved.poolOptions = {
|
|
3557
|
-
...resolved.poolOptions,
|
|
3558
|
-
threads: {
|
|
3559
|
-
...resolved.poolOptions?.threads,
|
|
3560
|
-
minThreads: Number.parseInt(process.env.VITEST_MIN_THREADS)
|
|
3561
|
-
},
|
|
3562
|
-
vmThreads: {
|
|
3563
|
-
...resolved.poolOptions?.vmThreads,
|
|
3564
|
-
minThreads: Number.parseInt(process.env.VITEST_MIN_THREADS)
|
|
3565
|
-
}
|
|
3566
|
-
};
|
|
3567
3557
|
if (process.env.VITEST_MAX_FORKS) resolved.poolOptions = {
|
|
3568
3558
|
...resolved.poolOptions,
|
|
3569
3559
|
forks: {
|
|
@@ -3575,30 +3565,9 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
3575
3565
|
maxForks: Number.parseInt(process.env.VITEST_MAX_FORKS)
|
|
3576
3566
|
}
|
|
3577
3567
|
};
|
|
3578
|
-
|
|
3579
|
-
...resolved.poolOptions,
|
|
3580
|
-
forks: {
|
|
3581
|
-
...resolved.poolOptions?.forks,
|
|
3582
|
-
minForks: Number.parseInt(process.env.VITEST_MIN_FORKS)
|
|
3583
|
-
},
|
|
3584
|
-
vmForks: {
|
|
3585
|
-
...resolved.poolOptions?.vmForks,
|
|
3586
|
-
minForks: Number.parseInt(process.env.VITEST_MIN_FORKS)
|
|
3587
|
-
}
|
|
3588
|
-
};
|
|
3589
|
-
const poolThreadsOptions = [
|
|
3590
|
-
["threads", "minThreads"],
|
|
3591
|
-
["threads", "maxThreads"],
|
|
3592
|
-
["vmThreads", "minThreads"],
|
|
3593
|
-
["vmThreads", "maxThreads"]
|
|
3594
|
-
];
|
|
3568
|
+
const poolThreadsOptions = [["threads", "maxThreads"], ["vmThreads", "maxThreads"]];
|
|
3595
3569
|
for (const [poolOptionKey, workerOptionKey] of poolThreadsOptions) if (resolved.poolOptions?.[poolOptionKey]?.[workerOptionKey]) resolved.poolOptions[poolOptionKey][workerOptionKey] = resolveInlineWorkerOption(resolved.poolOptions[poolOptionKey][workerOptionKey]);
|
|
3596
|
-
const poolForksOptions = [
|
|
3597
|
-
["forks", "minForks"],
|
|
3598
|
-
["forks", "maxForks"],
|
|
3599
|
-
["vmForks", "minForks"],
|
|
3600
|
-
["vmForks", "maxForks"]
|
|
3601
|
-
];
|
|
3570
|
+
const poolForksOptions = [["forks", "maxForks"], ["vmForks", "maxForks"]];
|
|
3602
3571
|
for (const [poolOptionKey, workerOptionKey] of poolForksOptions) if (resolved.poolOptions?.[poolOptionKey]?.[workerOptionKey]) resolved.poolOptions[poolOptionKey][workerOptionKey] = resolveInlineWorkerOption(resolved.poolOptions[poolOptionKey][workerOptionKey]);
|
|
3603
3572
|
if (!builtinPools.includes(resolved.pool)) resolved.pool = resolvePath(resolved.pool, resolved.root);
|
|
3604
3573
|
if (mode === "benchmark") {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.D_Q9UYh-.js';
|
|
2
|
-
import {
|
|
3
|
-
import './vi.
|
|
2
|
+
import { i as index } from './index.C832ioot.js';
|
|
3
|
+
import './vi.BB37KeLx.js';
|
|
4
4
|
import '@vitest/expect';
|
|
5
5
|
import '@vitest/runner';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
7
|
-
import '
|
|
8
|
-
import './utils.C7__0Iv5.js';
|
|
7
|
+
import './utils.D2R2NiOH.js';
|
|
9
8
|
import '@vitest/utils';
|
|
10
9
|
import './_commonjsHelpers.BFTU3MAI.js';
|
|
11
10
|
import '@vitest/snapshot';
|
|
@@ -13,14 +12,14 @@ import '@vitest/utils/error';
|
|
|
13
12
|
import '@vitest/spy';
|
|
14
13
|
import '@vitest/utils/source-map';
|
|
15
14
|
import './date.-jtEtIeV.js';
|
|
16
|
-
import './benchmark.
|
|
15
|
+
import './benchmark.CJUa-Hsa.js';
|
|
17
16
|
import 'expect-type';
|
|
18
17
|
import 'vite/module-runner';
|
|
19
18
|
|
|
20
19
|
function registerApiGlobally() {
|
|
21
20
|
globalApis.forEach((api) => {
|
|
22
21
|
// @ts-expect-error I know what I am doing :P
|
|
23
|
-
globalThis[api] =
|
|
22
|
+
globalThis[api] = index[api];
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, promises } from 'node:fs';
|
|
2
2
|
import { mkdir, writeFile, readdir, stat, readFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, dirname, isAbsolute, relative, basename, normalize } from 'pathe';
|
|
4
|
-
import { g as getOutputFile, h as hasFailedSnapshot, T as TypeCheckError } from './typechecker.
|
|
4
|
+
import { g as getOutputFile, h as hasFailedSnapshot, T as TypeCheckError } from './typechecker.DB-fIMaH.js';
|
|
5
5
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
6
6
|
import { getTestName, getFullName, hasFailed, getTests, getSuites, getTasks } from '@vitest/runner/utils';
|
|
7
7
|
import { slash, toArray, isPrimitive, inspect, positionToOffset, lineSplitRE } from '@vitest/utils';
|