vitest 4.0.0-beta.11 → 4.0.0-beta.13
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/LICENSE.md +4 -101
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +2 -2
- package/dist/chunks/{benchmark.LXhJ0F0X.js → benchmark.DHKMYAts.js} +1 -1
- package/dist/chunks/{browser.d.Dx7DO_Ce.d.ts → browser.d.D9YV3JvA.d.ts} +1 -1
- package/dist/chunks/{cac.elvK37c9.js → cac.BBtYKH7y.js} +16 -9
- package/dist/chunks/{cli-api.C7plPyhs.js → cli-api.CeakdBUN.js} +95 -148
- package/dist/chunks/{config.d.B_LthbQq.d.ts → config.d.DGazh2r6.d.ts} +3 -1
- package/dist/chunks/{console.CiTi59Jy.js → console.CTJL2nuH.js} +3 -5
- package/dist/chunks/{coverage.CG6Uhorw.js → coverage.DabP7UTQ.js} +69 -80
- package/dist/chunks/{creator.08Gi-vCA.js → creator.DfXDsUyL.js} +6 -8
- package/dist/chunks/{global.d.BK3X7FW1.d.ts → global.d.BcFPD2LN.d.ts} +0 -13
- package/dist/chunks/{globals.BjvYA-AD.js → globals.DC4ntO86.js} +5 -5
- package/dist/chunks/{index.DIWhzsUh.js → index.Bt-upxGS.js} +6 -12
- package/dist/chunks/{index.BwBttQPf.js → index.CHrBLuEH.js} +33 -38
- package/dist/chunks/{index.X0nbfr6-.js → index.Dc3xnDvT.js} +48 -289
- package/dist/chunks/{index.AZOjjqWP.js → index.Dnl38iQ_.js} +2 -2
- package/dist/chunks/{index.BhY64fF0.js → index.uLUz1RDt.js} +1 -1
- package/dist/chunks/{inspector.CvQD-Nie.js → inspector.Br76Q2Mb.js} +1 -4
- package/dist/chunks/{moduleRunner.d.BNa-CL9e.d.ts → moduleRunner.d.CeYc7nZ0.d.ts} +1 -1
- package/dist/chunks/{node.BsdMi6DV.js → node.BwAWWjHZ.js} +2 -3
- package/dist/chunks/{plugin.d.C5phQR6o.d.ts → plugin.d.COyglhiI.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CVzhsTvK.d.ts → reporters.d.xGvTJYG3.d.ts} +41 -4
- package/dist/chunks/{resolveSnapshotEnvironment.DQVamkje.js → resolveSnapshotEnvironment.BsJpmVZR.js} +7 -8
- package/dist/chunks/{rpc.jKGRSXIH.js → rpc.cD77ENhU.js} +12 -13
- package/dist/chunks/{setup-common.NAWRuMRP.js → setup-common.BewgbkTd.js} +5 -5
- package/dist/chunks/{startModuleRunner.oAuCu1yL.js → startModuleRunner.DPBo3mme.js} +40 -48
- package/dist/chunks/{test.KC5tH8hC.js → test.CTuWuHYH.js} +5 -5
- package/dist/chunks/{typechecker.gXq-5P3n.js → typechecker.BfOQ86_a.js} +54 -77
- package/dist/chunks/{utils.DGKhod2J.js → utils.CG9h5ccR.js} +1 -4
- package/dist/chunks/{vi.CiJ0Laa6.js → vi.B2--mG9U.js} +35 -144
- package/dist/chunks/{worker.rPGLlbkW.js → worker.DVTUM2IW.js} +11 -15
- package/dist/chunks/{worker.d.B_Fd9M_w.d.ts → worker.d.buwuBpBt.d.ts} +1 -1
- package/dist/cli.js +3 -3
- package/dist/config.d.ts +6 -6
- package/dist/coverage.d.ts +5 -5
- package/dist/coverage.js +3 -3
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +5 -5
- package/dist/module-evaluator.d.ts +3 -3
- package/dist/module-evaluator.js +10 -12
- package/dist/module-runner.js +2 -2
- package/dist/node.d.ts +8 -8
- package/dist/node.js +10 -10
- package/dist/reporters.d.ts +5 -5
- package/dist/reporters.js +3 -3
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +6 -6
- package/dist/snapshot.js +2 -2
- package/dist/suite.js +2 -2
- package/dist/worker-base.js +30 -32
- package/dist/worker-vm.js +19 -30
- package/dist/workers/runVmTests.js +10 -10
- package/package.json +18 -19
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.BBtYKH7y.js';
|
|
2
2
|
import '@vitest/utils/helpers';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
6
|
import './chunks/constants.D_Q9UYh-.js';
|
|
7
|
-
import './chunks/index.
|
|
7
|
+
import './chunks/index.CHrBLuEH.js';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
|
-
import './chunks/typechecker.
|
|
10
|
+
import './chunks/typechecker.BfOQ86_a.js';
|
|
11
11
|
import 'node:os';
|
|
12
12
|
import 'node:perf_hooks';
|
|
13
13
|
import 'tinyexec';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { HookHandler, ConfigEnv, UserConfig } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.
|
|
4
|
-
export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.
|
|
5
|
-
import { V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
-
import { F as FakeTimerInstallOpts } from './chunks/config.d.
|
|
3
|
+
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.xGvTJYG3.js';
|
|
4
|
+
export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.xGvTJYG3.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.COyglhiI.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.DGazh2r6.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import './chunks/environment.d.BsToaxti.js';
|
|
10
10
|
import 'node:stream';
|
|
11
11
|
import '@vitest/mocker';
|
|
12
12
|
import '@vitest/utils/source-map';
|
|
13
|
-
import './chunks/browser.d.
|
|
14
|
-
import './chunks/worker.d.
|
|
13
|
+
import './chunks/browser.d.D9YV3JvA.js';
|
|
14
|
+
import './chunks/worker.d.buwuBpBt.js';
|
|
15
15
|
import 'vite/module-runner';
|
|
16
16
|
import '@vitest/snapshot';
|
|
17
17
|
import '@vitest/pretty-format';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.xGvTJYG3.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.d.BsToaxti.js';
|
|
4
4
|
import '@vitest/runner';
|
|
@@ -6,13 +6,13 @@ import '@vitest/utils';
|
|
|
6
6
|
import 'node:stream';
|
|
7
7
|
import '@vitest/mocker';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
9
|
-
import './chunks/
|
|
10
|
-
import './chunks/worker.d.B_Fd9M_w.js';
|
|
11
|
-
import 'vite/module-runner';
|
|
12
|
-
import './chunks/config.d.B_LthbQq.js';
|
|
9
|
+
import './chunks/config.d.DGazh2r6.js';
|
|
13
10
|
import '@vitest/pretty-format';
|
|
14
11
|
import '@vitest/snapshot';
|
|
15
12
|
import '@vitest/utils/diff';
|
|
13
|
+
import './chunks/browser.d.D9YV3JvA.js';
|
|
14
|
+
import './chunks/worker.d.buwuBpBt.js';
|
|
15
|
+
import 'vite/module-runner';
|
|
16
16
|
import '@vitest/expect';
|
|
17
17
|
import 'vitest/optional-types.js';
|
|
18
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
package/dist/coverage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseCoverageProvider } from './chunks/coverage.
|
|
1
|
+
export { B as BaseCoverageProvider } from './chunks/coverage.DabP7UTQ.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
@@ -21,13 +21,13 @@ import 'node:util';
|
|
|
21
21
|
import 'vite';
|
|
22
22
|
import './chunks/constants.D_Q9UYh-.js';
|
|
23
23
|
import 'node:tty';
|
|
24
|
+
import './path.js';
|
|
24
25
|
import 'node:events';
|
|
25
26
|
import './chunks/index.Bgo3tNWt.js';
|
|
26
27
|
import 'tinypool';
|
|
27
|
-
import './chunks/typechecker.
|
|
28
|
+
import './chunks/typechecker.BfOQ86_a.js';
|
|
28
29
|
import 'node:perf_hooks';
|
|
29
30
|
import 'tinyexec';
|
|
30
|
-
import './path.js';
|
|
31
31
|
import '@vitest/runner/utils';
|
|
32
32
|
import 'node:worker_threads';
|
|
33
33
|
import './chunks/coverage.D_JHT54q.js';
|
package/dist/environments.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.Bt-upxGS.js';
|
|
2
2
|
import 'node:console';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { S as SerializedTestSpecification } from './chunks/browser.d.
|
|
2
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
3
|
-
import './chunks/global.d.
|
|
1
|
+
import { S as SerializedTestSpecification } from './chunks/browser.d.D9YV3JvA.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.D9YV3JvA.js';
|
|
3
|
+
import './chunks/global.d.BcFPD2LN.js';
|
|
4
4
|
import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
|
|
5
|
-
export { CancelReason,
|
|
6
|
-
import { B as BirpcReturn } from './chunks/worker.d.
|
|
7
|
-
export { C as ContextRPC, b as ContextTestEnvironment, R as RunnerRPC, a as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
8
|
-
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.
|
|
9
|
-
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.
|
|
5
|
+
export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
|
+
import { B as BirpcReturn } from './chunks/worker.d.buwuBpBt.js';
|
|
7
|
+
export { C as ContextRPC, b as ContextTestEnvironment, R as RunnerRPC, a as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.buwuBpBt.js';
|
|
8
|
+
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.DGazh2r6.js';
|
|
9
|
+
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.DGazh2r6.js';
|
|
10
10
|
import { b as Awaitable, U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/environment.d.BsToaxti.js';
|
|
11
11
|
export { A as AfterSuiteRunMeta } from './chunks/environment.d.BsToaxti.js';
|
|
12
12
|
import { ExpectStatic } from '@vitest/expect';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { b as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, d as vitest } from './chunks/vi.
|
|
2
|
-
export { b as bench } from './chunks/benchmark.
|
|
3
|
-
export { a as assertType } from './chunks/index.
|
|
1
|
+
export { b as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, d as vitest } from './chunks/vi.B2--mG9U.js';
|
|
2
|
+
export { b as bench } from './chunks/benchmark.DHKMYAts.js';
|
|
3
|
+
export { a as assertType } from './chunks/index.Dnl38iQ_.js';
|
|
4
4
|
export { expectTypeOf } from 'expect-type';
|
|
5
5
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
6
|
export { EvaluatedModules } from 'vite/module-runner';
|
|
7
7
|
export { chai } from '@vitest/expect';
|
|
8
8
|
import '@vitest/runner/utils';
|
|
9
|
-
import './chunks/utils.
|
|
9
|
+
import './chunks/utils.CG9h5ccR.js';
|
|
10
10
|
import '@vitest/utils/timers';
|
|
11
|
-
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
12
11
|
import '@vitest/snapshot';
|
|
13
12
|
import '@vitest/utils/error';
|
|
14
13
|
import '@vitest/utils/helpers';
|
|
15
14
|
import '@vitest/spy';
|
|
16
15
|
import '@vitest/utils/offset';
|
|
17
16
|
import '@vitest/utils/source-map';
|
|
17
|
+
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
18
18
|
import './chunks/date.-jtEtIeV.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import 'vite/module-runner';
|
|
2
|
-
export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.
|
|
2
|
+
export { b as VitestModuleEvaluator, a as VitestModuleEvaluatorOptions, c as createImportMetaEnvProxy, g as getDefaultRequestStubs, i as isPrimitive, u as unwrapId, w as wrapId } from './chunks/moduleRunner.d.CeYc7nZ0.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
|
-
import './chunks/worker.d.
|
|
5
|
+
import './chunks/worker.d.buwuBpBt.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
|
-
import './chunks/config.d.
|
|
7
|
+
import './chunks/config.d.DGazh2r6.js';
|
|
8
8
|
import '@vitest/pretty-format';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/diff';
|
package/dist/module-evaluator.js
CHANGED
|
@@ -58,7 +58,8 @@ class VitestModuleEvaluator {
|
|
|
58
58
|
if (id in this.stubs) return this.stubs[id];
|
|
59
59
|
const file = this.convertIdToImportUrl(id), namespace = this.vm ? await this.vm.externalModulesExecutor.import(file) : await import(file);
|
|
60
60
|
if (!this.shouldInterop(file, namespace)) return namespace;
|
|
61
|
-
const { mod, defaultExport } = interopModule(namespace), { Proxy, Reflect } = this.primitives
|
|
61
|
+
const { mod, defaultExport } = interopModule(namespace), { Proxy, Reflect } = this.primitives;
|
|
62
|
+
return new Proxy(mod, {
|
|
62
63
|
get(mod, prop) {
|
|
63
64
|
return prop === "default" ? defaultExport : mod[prop] ?? defaultExport?.[prop];
|
|
64
65
|
},
|
|
@@ -75,7 +76,6 @@ class VitestModuleEvaluator {
|
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
|
-
return proxy;
|
|
79
79
|
}
|
|
80
80
|
async runInlinedModule(context, code, module) {
|
|
81
81
|
context.__vite_ssr_import_meta__.env = this.env;
|
|
@@ -107,8 +107,8 @@ class VitestModuleEvaluator {
|
|
|
107
107
|
get exports() {
|
|
108
108
|
return cjsExports;
|
|
109
109
|
}
|
|
110
|
-
}, meta = context[ssrImportMetaKey]
|
|
111
|
-
if (
|
|
110
|
+
}, meta = context[ssrImportMetaKey];
|
|
111
|
+
if (this.options.getCurrentTestFilepath?.() === module.file) {
|
|
112
112
|
const globalNamespace = this.vm?.context || globalThis;
|
|
113
113
|
Object.defineProperty(meta, "vitest", { get: () => globalNamespace.__vitest_index__ });
|
|
114
114
|
}
|
|
@@ -133,14 +133,13 @@ class VitestModuleEvaluator {
|
|
|
133
133
|
columnOffset: -codeDefinition.length
|
|
134
134
|
}, finishModuleExecutionInfo = this.debug.startCalculateModuleExecutionInfo(options.filename, codeDefinition.length);
|
|
135
135
|
try {
|
|
136
|
-
|
|
137
|
-
return dep = String(dep), dep[0] === "#" ? context[ssrDynamicImportKey](wrapId(dep), options) : context[ssrDynamicImportKey](dep, options);
|
|
138
|
-
};
|
|
139
|
-
await initModule(
|
|
136
|
+
await (this.vm ? vm.runInContext(wrappedCode, this.vm.context, options) : vm.runInThisContext(wrappedCode, options))(
|
|
140
137
|
context[ssrModuleExportsKey],
|
|
141
138
|
context[ssrImportMetaKey],
|
|
142
139
|
context[ssrImportKey],
|
|
143
|
-
|
|
140
|
+
async (dep, options) => {
|
|
141
|
+
return dep = String(dep), dep[0] === "#" ? context[ssrDynamicImportKey](wrapId(dep), options) : context[ssrDynamicImportKey](dep, options);
|
|
142
|
+
},
|
|
144
143
|
context[ssrExportAllKey],
|
|
145
144
|
// vite 7 support, remove when vite 7+ is supported
|
|
146
145
|
context.__vite_ssr_exportName__ || ((name, getter) => Object.defineProperty(exportsObject, name, {
|
|
@@ -179,7 +178,7 @@ function createImportMetaEnvProxy() {
|
|
|
179
178
|
];
|
|
180
179
|
return new Proxy(process.env, {
|
|
181
180
|
get(_, key) {
|
|
182
|
-
|
|
181
|
+
if (typeof key === "string") return booleanKeys.includes(key) ? !!process.env[key] : process.env[key];
|
|
183
182
|
},
|
|
184
183
|
set(_, key, value) {
|
|
185
184
|
if (typeof key !== "string") return true;
|
|
@@ -248,8 +247,7 @@ function defineExport(exports, key, value) {
|
|
|
248
247
|
});
|
|
249
248
|
}
|
|
250
249
|
function isPrimitive(v) {
|
|
251
|
-
|
|
252
|
-
return !isObject || v == null;
|
|
250
|
+
return !(typeof v === "object" || typeof v === "function") || v == null;
|
|
253
251
|
}
|
|
254
252
|
function interopModule(mod) {
|
|
255
253
|
if (isPrimitive(mod)) return {
|
package/dist/module-runner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { VitestModuleEvaluator } from './module-evaluator.js';
|
|
2
|
-
export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.
|
|
3
|
-
export { g as getWorkerState } from './chunks/utils.
|
|
2
|
+
export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.DPBo3mme.js';
|
|
3
|
+
export { g as getWorkerState } from './chunks/utils.CG9h5ccR.js';
|
|
4
4
|
import 'node:module';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'node:vm';
|
package/dist/node.d.ts
CHANGED
|
@@ -3,24 +3,24 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as Pool, l as TestSequencer, L as Logger } from './chunks/reporters.d.
|
|
7
|
-
export { al as BaseCoverageOptions, G as BenchmarkUserOptions, K as BrowserBuiltinProvider, N as BrowserCommand, Q as BrowserCommandContext, X as BrowserConfigOptions, Y as BrowserInstanceOption, Z as BrowserModuleMocker, _ as BrowserOrchestrator, $ as BrowserProvider, a0 as BrowserProviderOption, a1 as BrowserScript, a2 as BrowserServerState, a3 as BrowserServerStateSession, aa as BuiltinEnvironment, a4 as CDPSession, ab as CSSModuleScopeStrategy, am as CoverageIstanbulOptions, an as CoverageOptions, ao as CoverageProvider, ap as CoverageProviderModule, aq as CoverageReporter, c as CoverageV8Options, ar as CustomProviderOptions, ac as DepsOptimizationOptions, ad as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, o as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, a5 as ParentProjectBrowser, ae as PoolOptions, a6 as ProjectBrowser, af as ProjectConfig, b as ReportContext, at as ReportedHookContext, au as Reporter, ah as ResolveSnapshotPathHandler, ai as ResolveSnapshotPathHandlerContext, a7 as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ag as ResolvedProjectConfig, S as SerializedTestProject, p as TaskOptions, q as TestCase, r as TestCollection, s as TestDiagnostic, t as TestModule, u as TestModuleState, v as TestResult, w as TestResultFailed, x as TestResultPassed, y as TestResultSkipped, av as TestRunEndReason, as as TestRunResult, F as TestSequencerConstructor, z as TestState, B as TestSuite, D as TestSuiteState, a8 as ToMatchScreenshotComparators, a9 as ToMatchScreenshotOptions, aj as TypecheckConfig, U as UserWorkspaceConfig, ak as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, E as experimental_getRunnerTask } from './chunks/reporters.d.
|
|
6
|
+
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, k as TestSpecification, T as TestProject, P as Pool, l as TestSequencer, L as Logger } from './chunks/reporters.d.xGvTJYG3.js';
|
|
7
|
+
export { al as BaseCoverageOptions, G as BenchmarkUserOptions, K as BrowserBuiltinProvider, N as BrowserCommand, Q as BrowserCommandContext, X as BrowserConfigOptions, Y as BrowserInstanceOption, Z as BrowserModuleMocker, _ as BrowserOrchestrator, $ as BrowserProvider, a0 as BrowserProviderOption, a1 as BrowserScript, a2 as BrowserServerState, a3 as BrowserServerStateSession, aa as BuiltinEnvironment, a4 as CDPSession, ab as CSSModuleScopeStrategy, am as CoverageIstanbulOptions, an as CoverageOptions, ao as CoverageProvider, ap as CoverageProviderModule, aq as CoverageReporter, c as CoverageV8Options, ar as CustomProviderOptions, ac as DepsOptimizationOptions, ad as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, o as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, a5 as ParentProjectBrowser, ae as PoolOptions, a6 as ProjectBrowser, af as ProjectConfig, b as ReportContext, at as ReportedHookContext, au as Reporter, ah as ResolveSnapshotPathHandler, ai as ResolveSnapshotPathHandlerContext, a7 as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ag as ResolvedProjectConfig, S as SerializedTestProject, p as TaskOptions, q as TestCase, r as TestCollection, s as TestDiagnostic, t as TestModule, u as TestModuleState, v as TestResult, w as TestResultFailed, x as TestResultPassed, y as TestResultSkipped, av as TestRunEndReason, as as TestRunResult, F as TestSequencerConstructor, z as TestState, B as TestSuite, D as TestSuiteState, a8 as ToMatchScreenshotComparators, a9 as ToMatchScreenshotOptions, aj as TypecheckConfig, U as UserWorkspaceConfig, ak as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, E as experimental_getRunnerTask } from './chunks/reporters.d.xGvTJYG3.js';
|
|
8
8
|
import { Awaitable } from '@vitest/utils';
|
|
9
9
|
export { SerializedError } from '@vitest/utils';
|
|
10
|
-
import { a as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.
|
|
11
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
10
|
+
import { a as RuntimeRPC, C as ContextRPC } from './chunks/worker.d.buwuBpBt.js';
|
|
11
|
+
export { T as TestExecutionType } from './chunks/worker.d.buwuBpBt.js';
|
|
12
12
|
import { Writable } from 'node:stream';
|
|
13
|
-
export { V as VitestPluginContext } from './chunks/plugin.d.
|
|
13
|
+
export { V as VitestPluginContext } from './chunks/plugin.d.COyglhiI.js';
|
|
14
14
|
import { MessagePort } from 'node:worker_threads';
|
|
15
15
|
import { Debugger } from 'debug';
|
|
16
|
-
import './chunks/global.d.
|
|
16
|
+
import './chunks/global.d.BcFPD2LN.js';
|
|
17
17
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
18
|
-
export { b as RuntimeConfig } from './chunks/config.d.
|
|
18
|
+
export { b as RuntimeConfig } from './chunks/config.d.DGazh2r6.js';
|
|
19
19
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
20
20
|
import './chunks/environment.d.BsToaxti.js';
|
|
21
21
|
import '@vitest/mocker';
|
|
22
22
|
import '@vitest/utils/source-map';
|
|
23
|
-
import './chunks/browser.d.
|
|
23
|
+
import './chunks/browser.d.D9YV3JvA.js';
|
|
24
24
|
import '@vitest/pretty-format';
|
|
25
25
|
import '@vitest/snapshot';
|
|
26
26
|
import '@vitest/utils/diff';
|
package/dist/node.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.
|
|
5
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, h as createDebugger, g as createViteLogger, c as createVitest, e as escapeTestName, d as experimental_getRunnerTask, i as isValidApiRequest, f as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
7
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
8
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.CeakdBUN.js';
|
|
5
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, h as createDebugger, g as createViteLogger, c as createVitest, e as escapeTestName, d as experimental_getRunnerTask, i as isValidApiRequest, f as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.CeakdBUN.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.BBtYKH7y.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.DabP7UTQ.js';
|
|
8
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.DabP7UTQ.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils/helpers';
|
|
10
|
-
import {
|
|
10
|
+
import { a as any } from './chunks/index.Dc3xnDvT.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
12
12
|
import { c as configFiles } from './chunks/constants.D_Q9UYh-.js';
|
|
13
13
|
export { distDir, rootDir } from './path.js';
|
|
@@ -18,9 +18,9 @@ import 'node:path';
|
|
|
18
18
|
import 'node:os';
|
|
19
19
|
import '@vitest/snapshot/manager';
|
|
20
20
|
import './chunks/index.Bgo3tNWt.js';
|
|
21
|
-
import './chunks/index.
|
|
21
|
+
import './chunks/index.CHrBLuEH.js';
|
|
22
22
|
import 'node:fs/promises';
|
|
23
|
-
import './chunks/typechecker.
|
|
23
|
+
import './chunks/typechecker.BfOQ86_a.js';
|
|
24
24
|
import 'node:perf_hooks';
|
|
25
25
|
import 'tinyexec';
|
|
26
26
|
import '@vitest/utils/source-map';
|
|
@@ -58,7 +58,7 @@ import './chunks/defaults.CXFFjsi8.js';
|
|
|
58
58
|
import '@vitest/utils/constants';
|
|
59
59
|
import '@vitest/utils/resolver';
|
|
60
60
|
import 'es-module-lexer';
|
|
61
|
-
import './chunks/index.
|
|
61
|
+
import './chunks/index.uLUz1RDt.js';
|
|
62
62
|
import 'node:assert';
|
|
63
63
|
import '@vitest/utils/serialize';
|
|
64
64
|
import 'node:readline';
|
|
@@ -72,7 +72,7 @@ import 'readline';
|
|
|
72
72
|
|
|
73
73
|
// this is only exported as a public function and not used inside vitest
|
|
74
74
|
async function resolveConfig(options = {}, viteOverrides = {}) {
|
|
75
|
-
const root = slash(resolve(options.root || process.cwd())), configPath = options.config === false ? false : options.config ? resolve(root, options.config) :
|
|
75
|
+
const root = slash(resolve(options.root || process.cwd())), configPath = options.config === false ? false : options.config ? resolve(root, options.config) : any(configFiles, { cwd: root });
|
|
76
76
|
options.config = configPath;
|
|
77
77
|
const vitest = new Vitest("test", deepClone(options)), config = await resolveConfig$1(mergeConfig({
|
|
78
78
|
configFile: configPath,
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aJ as BaseReporter, aK as BenchmarkBuiltinReporters, aw as BenchmarkReporter, ax as BenchmarkReportsMap, aL as BuiltinReporterOptions, aM as BuiltinReporters, ay as DefaultReporter, az as DotReporter, aA as GithubActionsReporter, aB as HangingProcessReporter, aD as JUnitReporter, aN as JsonAssertionResult, aC as JsonReporter, aO as JsonTestResult, aP as JsonTestResults, at as ReportedHookContext, au as Reporter, aE as ReportersMap, aF as TapFlatReporter, aG as TapReporter, av as TestRunEndReason, aH as VerboseBenchmarkReporter, aI as VerboseReporter } from './chunks/reporters.d.
|
|
1
|
+
export { aJ as BaseReporter, aK as BenchmarkBuiltinReporters, aw as BenchmarkReporter, ax as BenchmarkReportsMap, aL as BuiltinReporterOptions, aM as BuiltinReporters, ay as DefaultReporter, az as DotReporter, aA as GithubActionsReporter, aB as HangingProcessReporter, aD as JUnitReporter, aN as JsonAssertionResult, aC as JsonReporter, aO as JsonTestResult, aP as JsonTestResults, at as ReportedHookContext, au as Reporter, aE as ReportersMap, aF as TapFlatReporter, aG as TapReporter, av as TestRunEndReason, aH as VerboseBenchmarkReporter, aI as VerboseReporter } from './chunks/reporters.d.xGvTJYG3.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import './chunks/environment.d.BsToaxti.js';
|
|
@@ -6,13 +6,13 @@ import 'node:stream';
|
|
|
6
6
|
import 'vite';
|
|
7
7
|
import '@vitest/mocker';
|
|
8
8
|
import '@vitest/utils/source-map';
|
|
9
|
-
import './chunks/
|
|
10
|
-
import './chunks/worker.d.B_Fd9M_w.js';
|
|
11
|
-
import 'vite/module-runner';
|
|
12
|
-
import './chunks/config.d.B_LthbQq.js';
|
|
9
|
+
import './chunks/config.d.DGazh2r6.js';
|
|
13
10
|
import '@vitest/pretty-format';
|
|
14
11
|
import '@vitest/snapshot';
|
|
15
12
|
import '@vitest/utils/diff';
|
|
13
|
+
import './chunks/browser.d.D9YV3JvA.js';
|
|
14
|
+
import './chunks/worker.d.buwuBpBt.js';
|
|
15
|
+
import 'vite/module-runner';
|
|
16
16
|
import '@vitest/expect';
|
|
17
17
|
import 'vitest/optional-types.js';
|
|
18
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
package/dist/reporters.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.CHrBLuEH.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.uLUz1RDt.js';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
|
6
|
-
import './chunks/typechecker.
|
|
6
|
+
import './chunks/typechecker.BfOQ86_a.js';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import 'node:perf_hooks';
|
|
9
9
|
import 'tinyexec';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
2
|
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
|
|
3
3
|
export { VitestRunner } from '@vitest/runner';
|
|
4
|
-
import { a as SerializedConfig } from './chunks/config.d.
|
|
4
|
+
import { a as SerializedConfig } from './chunks/config.d.DGazh2r6.js';
|
|
5
5
|
import '@vitest/pretty-format';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
7
|
import '@vitest/utils/diff';
|
package/dist/runners.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.
|
|
1
|
+
export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './chunks/test.CTuWuHYH.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils/helpers';
|
|
4
4
|
import '@vitest/utils/timers';
|
|
5
|
-
import './chunks/benchmark.
|
|
5
|
+
import './chunks/benchmark.DHKMYAts.js';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
7
|
-
import './chunks/utils.
|
|
7
|
+
import './chunks/utils.CG9h5ccR.js';
|
|
8
8
|
import '@vitest/expect';
|
|
9
9
|
import '@vitest/utils/error';
|
|
10
10
|
import 'pathe';
|
|
11
|
-
import './chunks/vi.
|
|
12
|
-
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
11
|
+
import './chunks/vi.B2--mG9U.js';
|
|
13
12
|
import '@vitest/snapshot';
|
|
14
13
|
import '@vitest/spy';
|
|
15
14
|
import '@vitest/utils/offset';
|
|
16
15
|
import '@vitest/utils/source-map';
|
|
16
|
+
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
17
17
|
import './chunks/date.-jtEtIeV.js';
|
|
18
|
-
import './chunks/rpc.
|
|
18
|
+
import './chunks/rpc.cD77ENhU.js';
|
|
19
19
|
import './chunks/index.Bgo3tNWt.js';
|
package/dist/snapshot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.
|
|
1
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.BwAWWjHZ.js';
|
|
2
2
|
import '@vitest/snapshot/environment';
|
|
3
|
-
import './chunks/utils.
|
|
3
|
+
import './chunks/utils.CG9h5ccR.js';
|
|
4
4
|
import '@vitest/utils/timers';
|
package/dist/suite.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.DHKMYAts.js';
|
|
2
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
3
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
5
|
-
import './chunks/utils.
|
|
5
|
+
import './chunks/utils.CG9h5ccR.js';
|
|
6
6
|
import '@vitest/utils/timers';
|
package/dist/worker-base.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { c as createForksRpcOptions, u as unwrapSerializableConfig, a as createThreadsRpcOptions, e as execute, t as teardown$1 } from './chunks/worker.
|
|
1
|
+
import { c as createForksRpcOptions, u as unwrapSerializableConfig, a as createThreadsRpcOptions, e as execute, t as teardown$1 } from './chunks/worker.DVTUM2IW.js';
|
|
2
2
|
import v8 from 'node:v8';
|
|
3
3
|
import { runInThisContext } from 'node:vm';
|
|
4
4
|
import * as spyModule from '@vitest/spy';
|
|
5
5
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
6
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './chunks/startModuleRunner.
|
|
6
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './chunks/startModuleRunner.DPBo3mme.js';
|
|
7
7
|
import { performance } from 'node:perf_hooks';
|
|
8
8
|
import { startTests, collectTests } from '@vitest/runner';
|
|
9
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './chunks/resolveSnapshotEnvironment.
|
|
10
|
-
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './chunks/setup-common.
|
|
11
|
-
import { g as globalExpect, v as vi } from './chunks/vi.
|
|
12
|
-
import { c as closeInspector } from './chunks/inspector.
|
|
9
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './chunks/resolveSnapshotEnvironment.BsJpmVZR.js';
|
|
10
|
+
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './chunks/setup-common.BewgbkTd.js';
|
|
11
|
+
import { g as globalExpect, v as vi } from './chunks/vi.B2--mG9U.js';
|
|
12
|
+
import { c as closeInspector } from './chunks/inspector.Br76Q2Mb.js';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
14
|
import timers from 'node:timers';
|
|
15
15
|
import timersPromises from 'node:timers/promises';
|
|
16
16
|
import util from 'node:util';
|
|
17
17
|
import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
|
|
18
18
|
import { getSafeTimers } from '@vitest/utils/timers';
|
|
19
|
-
import { i as index } from './chunks/index.
|
|
20
|
-
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './chunks/utils.
|
|
19
|
+
import { i as index } from './chunks/index.Dnl38iQ_.js';
|
|
20
|
+
import { g as getWorkerState, r as resetModules, p as provideWorkerState } from './chunks/utils.CG9h5ccR.js';
|
|
21
21
|
import '@vitest/utils/source-map';
|
|
22
22
|
import 'node:fs';
|
|
23
23
|
import 'node:url';
|
|
24
24
|
import 'pathe';
|
|
25
|
-
import './chunks/index.
|
|
25
|
+
import './chunks/index.Bt-upxGS.js';
|
|
26
26
|
import 'node:console';
|
|
27
|
-
import './chunks/rpc.
|
|
27
|
+
import './chunks/rpc.cD77ENhU.js';
|
|
28
28
|
import './chunks/index.Bgo3tNWt.js';
|
|
29
29
|
import '@vitest/utils/helpers';
|
|
30
30
|
import './path.js';
|
|
@@ -33,14 +33,14 @@ import '@vitest/utils/serialize';
|
|
|
33
33
|
import './module-evaluator.js';
|
|
34
34
|
import '@vitest/mocker';
|
|
35
35
|
import '@vitest/expect';
|
|
36
|
-
import './chunks/test.
|
|
37
|
-
import './chunks/benchmark.
|
|
36
|
+
import './chunks/test.CTuWuHYH.js';
|
|
37
|
+
import './chunks/benchmark.DHKMYAts.js';
|
|
38
38
|
import '@vitest/runner/utils';
|
|
39
39
|
import '@vitest/utils/error';
|
|
40
40
|
import './chunks/coverage.D_JHT54q.js';
|
|
41
41
|
import '@vitest/snapshot';
|
|
42
|
-
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
43
42
|
import '@vitest/utils/offset';
|
|
43
|
+
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
44
44
|
import './chunks/date.-jtEtIeV.js';
|
|
45
45
|
import 'expect-type';
|
|
46
46
|
|
|
@@ -53,20 +53,19 @@ async function setupGlobalEnv(config, { environment }, moduleRunner) {
|
|
|
53
53
|
});
|
|
54
54
|
const state = getWorkerState();
|
|
55
55
|
if (!state.config.snapshotOptions.snapshotEnvironment) state.config.snapshotOptions.snapshotEnvironment = await resolveSnapshotEnvironment(config, moduleRunner);
|
|
56
|
-
if (globalSetup)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, !config.disableConsoleIntercept) await setupConsoleLogSpy();
|
|
56
|
+
if (!globalSetup) {
|
|
57
|
+
if (globalSetup = true, (environment.viteEnvironment || environment.name) === "client") {
|
|
58
|
+
const _require = createRequire(import.meta.url);
|
|
59
|
+
_require.extensions[".css"] = resolveCss, _require.extensions[".scss"] = resolveCss, _require.extensions[".sass"] = resolveCss, _require.extensions[".less"] = resolveCss, KNOWN_ASSET_TYPES.forEach((type) => {
|
|
60
|
+
_require.extensions[`.${type}`] = resolveAsset;
|
|
61
|
+
}), process.env.SSR = "";
|
|
62
|
+
} else process.env.SSR = "1";
|
|
63
|
+
if (globalThis.__vitest_required__ = {
|
|
64
|
+
util,
|
|
65
|
+
timers,
|
|
66
|
+
timersPromises
|
|
67
|
+
}, !config.disableConsoleIntercept) await setupConsoleLogSpy();
|
|
68
|
+
}
|
|
70
69
|
}
|
|
71
70
|
function resolveCss(mod) {
|
|
72
71
|
mod.exports = "";
|
|
@@ -75,7 +74,7 @@ function resolveAsset(mod, url) {
|
|
|
75
74
|
mod.exports = url;
|
|
76
75
|
}
|
|
77
76
|
async function setupConsoleLogSpy() {
|
|
78
|
-
const { createCustomConsole } = await import('./chunks/console.
|
|
77
|
+
const { createCustomConsole } = await import('./chunks/console.CTJL2nuH.js');
|
|
79
78
|
globalThis.console = createCustomConsole();
|
|
80
79
|
}
|
|
81
80
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -118,14 +117,13 @@ function startModuleRunner(options) {
|
|
|
118
117
|
async function runBaseTests(method, state) {
|
|
119
118
|
const { ctx } = state;
|
|
120
119
|
if (state.evaluatedModules = evaluatedModules, state.moduleExecutionInfo = moduleExecutionInfo, provideWorkerState(globalThis, state), ctx.invalidates) ctx.invalidates.forEach((filepath) => {
|
|
121
|
-
|
|
122
|
-
modules.forEach((module) => {
|
|
120
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
123
121
|
state.evaluatedModules.invalidateModule(module);
|
|
124
122
|
});
|
|
125
123
|
});
|
|
126
124
|
ctx.files.forEach((i) => {
|
|
127
|
-
const filepath = typeof i === "string" ? i : i.filepath
|
|
128
|
-
|
|
125
|
+
const filepath = typeof i === "string" ? i : i.filepath;
|
|
126
|
+
(state.evaluatedModules.fileToModulesMap.get(filepath) || []).forEach((module) => {
|
|
129
127
|
state.evaluatedModules.invalidateModule(module);
|
|
130
128
|
});
|
|
131
129
|
});
|