vitest 4.0.17 → 4.1.0-beta.2
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 +36 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +2 -2
- package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
- package/dist/chunks/{base.XJJQZiKB.js → base.DiopZV8F.js} +49 -14
- package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.BoqSLF53.js} +1 -1
- package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.BE4kbYok.d.ts} +4 -1
- package/dist/chunks/{cac.jRCLJDDc.js → cac.C4jjt2RX.js} +816 -14
- package/dist/chunks/{cli-api.Cx2DW4Bc.js → cli-api.ChbI1JU9.js} +412 -166
- package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.Cr1Ep39N.d.ts} +13 -11
- package/dist/chunks/{console.Cf-YriPC.js → console.CNlG1KsP.js} +3 -2
- package/dist/chunks/{constants.D_Q9UYh-.js → constants.B63TT-Bl.js} +1 -1
- package/dist/chunks/coverage.tyqbzn4W.js +1001 -0
- package/dist/chunks/{creator.DAmOKTvJ.js → creator.yyCHuw5R.js} +33 -2
- package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.JeWMqlOm.d.ts} +1 -1
- package/dist/chunks/{globals.DOayXfHP.js → globals.C6Ecf1TO.js} +11 -10
- package/dist/chunks/{index.M8mOzt4Y.js → index.B-iBE_Gx.js} +21 -5
- package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
- package/dist/chunks/{index.6Qv1eEA6.js → index.CAN630q3.js} +20 -8
- package/dist/chunks/{index.C5r1PdPD.js → index.CFulQRmC.js} +1 -1
- package/dist/chunks/{index.Z5E_ObnR.js → index.CouFDptX.js} +4 -2
- package/dist/chunks/{init-forks.BC6ZwHQN.js → init-forks.BnCXPazU.js} +1 -1
- package/dist/chunks/{init-threads.CxSxLC0N.js → init-threads.Cyh2PqXi.js} +1 -1
- package/dist/chunks/{init.C9kljSTm.js → init.B95Mm0Iz.js} +65 -12
- package/dist/chunks/native.mV0-490A.js +148 -0
- package/dist/chunks/nativeModuleMocker.D_q5sFv6.js +206 -0
- package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
- package/dist/chunks/{node.Ce0vMQM7.js → node.CrSEwhm4.js} +1 -1
- package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.C9o5bttz.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.7faYdkxy.d.ts} +146 -49
- package/dist/chunks/rpc.DcRWTy5G.js +148 -0
- package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.CM7x9-sm.d.ts} +1 -0
- package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.cvFp-ao9.js} +2 -2
- package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.BK-u7y4N.js} +182 -391
- package/dist/chunks/{vi.2VT5v0um.js → test.G82XYNFk.js} +505 -119
- package/dist/chunks/{utils.DvEY5TfP.js → utils.DT4VyRyl.js} +5 -1
- package/dist/chunks/{vm.CMjifoPa.js → vm.BdLtzhnj.js} +15 -11
- package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.CPzI2ZzJ.d.ts} +2 -2
- package/dist/cli.js +4 -3
- package/dist/config.d.ts +11 -11
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +10 -8
- package/dist/coverage.js +7 -4
- package/dist/environments.js +2 -0
- package/dist/index.d.ts +30 -23
- package/dist/index.js +9 -8
- package/dist/module-evaluator.d.ts +10 -1
- package/dist/module-evaluator.js +1 -5
- package/dist/node.d.ts +13 -12
- package/dist/node.js +27 -25
- package/dist/nodejs-worker-loader.js +41 -0
- package/dist/reporters.d.ts +8 -8
- package/dist/reporters.js +4 -2
- package/dist/runners.d.ts +24 -4
- package/dist/runners.js +6 -6
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +35 -0
- package/dist/snapshot.js +4 -2
- package/dist/suite.js +4 -2
- package/dist/worker.d.ts +8 -7
- package/dist/worker.js +25 -20
- package/dist/workers/forks.js +21 -16
- package/dist/workers/runVmTests.js +11 -13
- package/dist/workers/threads.js +21 -16
- package/dist/workers/vmForks.js +14 -11
- package/dist/workers/vmThreads.js +14 -11
- package/package.json +28 -29
- package/suppress-warnings.cjs +1 -0
- package/dist/chunks/date.Bq6ZW5rf.js +0 -73
- package/dist/chunks/rpc.BoxB0q7B.js +0 -76
- package/dist/chunks/test.B8ej_ZHS.js +0 -254
- package/dist/mocker.d.ts +0 -1
- package/dist/mocker.js +0 -1
- package/dist/module-runner.js +0 -17
|
@@ -7,6 +7,10 @@ function getWorkerState() {
|
|
|
7
7
|
if (!workerState) throw new Error("Vitest failed to access its internal state.\n\nOne of the following is possible:\n- \"vitest\" is imported directly without running \"vitest\" command\n- \"vitest\" is imported inside \"globalSetup\" (to fix this, use \"setupFiles\" instead, because \"globalSetup\" runs in a different context)\n- \"vitest\" is imported inside Vite / Vitest config file\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n");
|
|
8
8
|
return workerState;
|
|
9
9
|
}
|
|
10
|
+
function getSafeWorkerState() {
|
|
11
|
+
// @ts-expect-error untyped global
|
|
12
|
+
return globalThis[NAME_WORKER_STATE];
|
|
13
|
+
}
|
|
10
14
|
function provideWorkerState(context, state) {
|
|
11
15
|
Object.defineProperty(context, NAME_WORKER_STATE, {
|
|
12
16
|
value: state,
|
|
@@ -49,4 +53,4 @@ async function waitForImportsToResolve() {
|
|
|
49
53
|
await waitForImportsToResolve();
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
export { getWorkerState as g, isChildProcess as i, provideWorkerState as p, resetModules as r, waitForImportsToResolve as w };
|
|
56
|
+
export { getSafeWorkerState as a, getWorkerState as g, isChildProcess as i, provideWorkerState as p, resetModules as r, waitForImportsToResolve as w };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
2
|
import vm, { isContext, runInContext } from 'node:vm';
|
|
3
3
|
import { dirname, basename, extname, normalize, resolve } from 'pathe';
|
|
4
|
-
import { l as loadEnvironment } from './init.
|
|
4
|
+
import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.B95Mm0Iz.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
|
-
import { createCustomConsole } from './console.
|
|
6
|
+
import { createCustomConsole } from './console.CNlG1KsP.js';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { createRequire, Module, isBuiltin } from 'node:module';
|
|
9
9
|
import { toArray, isBareImport } from '@vitest/utils/helpers';
|
|
@@ -11,8 +11,8 @@ import { findNearestPackageData } from '@vitest/utils/resolver';
|
|
|
11
11
|
import { dirname as dirname$1 } from 'node:path';
|
|
12
12
|
import { CSS_LANGS_RE, KNOWN_ASSET_RE } from '@vitest/utils/constants';
|
|
13
13
|
import { getDefaultRequestStubs } from '../module-evaluator.js';
|
|
14
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta,
|
|
15
|
-
import { p as provideWorkerState } from './utils.
|
|
14
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta, V as VITEST_VM_CONTEXT_SYMBOL } from './startVitestModuleRunner.BK-u7y4N.js';
|
|
15
|
+
import { p as provideWorkerState } from './utils.DT4VyRyl.js';
|
|
16
16
|
|
|
17
17
|
function interopCommonJsModule(interopDefault, mod) {
|
|
18
18
|
if (isPrimitive(mod) || Array.isArray(mod) || mod instanceof Promise) return {
|
|
@@ -674,7 +674,7 @@ const packageCache = /* @__PURE__ */ new Map();
|
|
|
674
674
|
async function runVmTests(method, state, traces) {
|
|
675
675
|
const { ctx, rpc } = state;
|
|
676
676
|
const beforeEnvironmentTime = performance.now();
|
|
677
|
-
const { environment } = await loadEnvironment(ctx.environment.name, ctx.config.root, rpc, traces);
|
|
677
|
+
const { environment } = await loadEnvironment(ctx.environment.name, ctx.config.root, rpc, traces, true);
|
|
678
678
|
state.environment = environment;
|
|
679
679
|
if (!environment.setupVM) {
|
|
680
680
|
const envName = ctx.environment.name;
|
|
@@ -708,6 +708,10 @@ async function runVmTests(method, state, traces) {
|
|
|
708
708
|
transform: rpc.transform,
|
|
709
709
|
viteClientModule: stubs["/@vite/client"]
|
|
710
710
|
});
|
|
711
|
+
process.exit = (code = process.exitCode || 0) => {
|
|
712
|
+
throw new Error(`process.exit unexpectedly called with "${code}"`);
|
|
713
|
+
};
|
|
714
|
+
listenForErrors(() => state);
|
|
711
715
|
const moduleRunner = startVitestModuleRunner({
|
|
712
716
|
context,
|
|
713
717
|
evaluatedModules: state.evaluatedModules,
|
|
@@ -716,6 +720,7 @@ async function runVmTests(method, state, traces) {
|
|
|
716
720
|
createImportMeta: createNodeImportMeta,
|
|
717
721
|
traces
|
|
718
722
|
});
|
|
723
|
+
emitModuleRunner(moduleRunner);
|
|
719
724
|
Object.defineProperty(context, VITEST_VM_CONTEXT_SYMBOL, {
|
|
720
725
|
value: {
|
|
721
726
|
context,
|
|
@@ -733,15 +738,14 @@ async function runVmTests(method, state, traces) {
|
|
|
733
738
|
}
|
|
734
739
|
await moduleRunner.mocker.initializeSpyModule();
|
|
735
740
|
const { run } = await moduleRunner.import(entryFile);
|
|
736
|
-
const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
737
|
-
filepath: f,
|
|
738
|
-
testLocations: void 0
|
|
739
|
-
} : f);
|
|
740
741
|
try {
|
|
741
|
-
await run(method,
|
|
742
|
+
await run(method, ctx.files, ctx.config, moduleRunner, traces);
|
|
742
743
|
} finally {
|
|
743
744
|
await traces.$("vitest.runtime.environment.teardown", () => vm.teardown?.());
|
|
744
745
|
}
|
|
745
746
|
}
|
|
747
|
+
function setupVmWorker(context) {
|
|
748
|
+
if (context.config.experimental.viteModuleRunner === false) throw new Error(`Pool "${context.pool}" cannot run with "experimental.viteModuleRunner: false". Please, use "threads" or "forks" instead.`);
|
|
749
|
+
}
|
|
746
750
|
|
|
747
|
-
export { runVmTests as r };
|
|
751
|
+
export { runVmTests as r, setupVmWorker as s };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FileSpecification, Task, CancelReason } from '@vitest/runner';
|
|
2
2
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
3
|
-
import { S as SerializedConfig } from './config.d.
|
|
3
|
+
import { S as SerializedConfig } from './config.d.Cr1Ep39N.js';
|
|
4
4
|
import { E as Environment } from './environment.d.CrsxCzP1.js';
|
|
5
|
-
import { R as RuntimeRPC, a as RunnerRPC } from './rpc.d.
|
|
5
|
+
import { R as RuntimeRPC, a as RunnerRPC } from './rpc.d.CM7x9-sm.js';
|
|
6
6
|
|
|
7
7
|
//#region src/messages.d.ts
|
|
8
8
|
declare const TYPE_REQUEST: "q";
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.C4jjt2RX.js';
|
|
2
2
|
import '@vitest/utils/helpers';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
|
-
import './chunks/constants.
|
|
7
|
-
import './chunks/index.
|
|
6
|
+
import './chunks/constants.B63TT-Bl.js';
|
|
7
|
+
import './chunks/index.B-iBE_Gx.js';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'node:perf_hooks';
|
|
@@ -24,5 +24,6 @@ import 'node:url';
|
|
|
24
24
|
import 'vite';
|
|
25
25
|
import '@vitest/utils/offset';
|
|
26
26
|
import 'node:module';
|
|
27
|
+
import 'node:assert';
|
|
27
28
|
|
|
28
29
|
createCLI().parse();
|
package/dist/config.d.ts
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { HookHandler, ConfigEnv, UserConfig } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { I as InlineConfig,
|
|
4
|
-
export {
|
|
5
|
-
import { V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
-
import { F as FakeTimerInstallOpts } from './chunks/config.d.
|
|
7
|
-
|
|
3
|
+
import { I as InlineConfig, C as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, b as UserProjectConfigFn, c as UserProjectConfigExport } from './chunks/reporters.d.7faYdkxy.js';
|
|
4
|
+
export { a as TestProjectConfiguration, e as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.7faYdkxy.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.C9o5bttz.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.Cr1Ep39N.js';
|
|
7
|
+
export { TestTagDefinition } from '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
|
-
import './chunks/rpc.d.
|
|
9
|
+
import './chunks/rpc.d.CM7x9-sm.js';
|
|
10
10
|
import '@vitest/snapshot';
|
|
11
11
|
import 'vite/module-runner';
|
|
12
12
|
import './chunks/traces.d.402V_yFI.js';
|
|
13
13
|
import 'node:stream';
|
|
14
|
-
import './chunks/browser.d.
|
|
15
|
-
import './chunks/worker.d.
|
|
14
|
+
import './chunks/browser.d.BE4kbYok.js';
|
|
15
|
+
import './chunks/worker.d.CPzI2ZzJ.js';
|
|
16
16
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
17
|
-
import '@vitest/mocker';
|
|
18
|
-
import '@vitest/utils/source-map';
|
|
19
|
-
import 'vitest/browser';
|
|
20
17
|
import '@vitest/pretty-format';
|
|
21
18
|
import '@vitest/utils/diff';
|
|
22
19
|
import '@vitest/expect';
|
|
@@ -24,6 +21,9 @@ import 'vitest/optional-types.js';
|
|
|
24
21
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
25
22
|
import '@vitest/runner/utils';
|
|
26
23
|
import 'tinybench';
|
|
24
|
+
import '@vitest/mocker';
|
|
25
|
+
import '@vitest/utils/source-map';
|
|
26
|
+
import 'vitest/browser';
|
|
27
27
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
28
28
|
import '@vitest/snapshot/manager';
|
|
29
29
|
import 'node:console';
|
package/dist/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.BOqNVLsY.js';
|
|
2
2
|
export { mergeConfig } from 'vite';
|
|
3
|
-
export { d as defaultBrowserPort } from './chunks/constants.
|
|
3
|
+
export { d as defaultBrowserPort } from './chunks/constants.B63TT-Bl.js';
|
|
4
4
|
import 'node:os';
|
|
5
5
|
import './chunks/env.D4Lgay0q.js';
|
|
6
6
|
import 'std-env';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest,
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, aY as CoverageMap, aW as ReportContext, T as TestProject } from './chunks/reporters.d.7faYdkxy.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
|
-
import { A as AfterSuiteRunMeta } from './chunks/rpc.d.
|
|
3
|
+
import { A as AfterSuiteRunMeta } from './chunks/rpc.d.CM7x9-sm.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import 'node:stream';
|
|
7
|
-
import './chunks/browser.d.
|
|
7
|
+
import './chunks/browser.d.BE4kbYok.js';
|
|
8
8
|
import './chunks/traces.d.402V_yFI.js';
|
|
9
|
-
import './chunks/worker.d.
|
|
9
|
+
import './chunks/worker.d.CPzI2ZzJ.js';
|
|
10
10
|
import 'vite/module-runner';
|
|
11
|
-
import './chunks/config.d.
|
|
11
|
+
import './chunks/config.d.Cr1Ep39N.js';
|
|
12
12
|
import '@vitest/pretty-format';
|
|
13
13
|
import '@vitest/snapshot';
|
|
14
14
|
import '@vitest/utils/diff';
|
|
15
15
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
16
|
-
import '@vitest/mocker';
|
|
17
|
-
import '@vitest/utils/source-map';
|
|
18
|
-
import 'vitest/browser';
|
|
19
16
|
import '@vitest/expect';
|
|
20
17
|
import 'vitest/optional-types.js';
|
|
21
18
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
22
19
|
import '@vitest/runner/utils';
|
|
23
20
|
import 'tinybench';
|
|
21
|
+
import '@vitest/mocker';
|
|
22
|
+
import '@vitest/utils/source-map';
|
|
23
|
+
import 'vitest/browser';
|
|
24
24
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
25
25
|
import '@vitest/snapshot/manager';
|
|
26
26
|
import 'node:console';
|
|
@@ -57,6 +57,7 @@ declare class BaseCoverageProvider<Options extends ResolvedCoverageOptions<"ista
|
|
|
57
57
|
version: string;
|
|
58
58
|
options: Options;
|
|
59
59
|
globCache: Map<string, boolean>;
|
|
60
|
+
autoUpdateMarker: string;
|
|
60
61
|
coverageFiles: CoverageFiles;
|
|
61
62
|
pendingPromises: Promise<void>[];
|
|
62
63
|
coverageFilesDirectory: string;
|
|
@@ -112,6 +113,7 @@ declare class BaseCoverageProvider<Options extends ResolvedCoverageOptions<"ista
|
|
|
112
113
|
mergeReports(coverageMaps: unknown[]): Promise<void>;
|
|
113
114
|
hasTerminalReporter(reporters: ResolvedCoverageOptions["reporter"]): boolean;
|
|
114
115
|
toSlices<T>(array: T[], size: number): T[][];
|
|
116
|
+
transformFile(url: string, project: TestProject, viteEnvironment: string): Promise<TransformResult | null | undefined>;
|
|
115
117
|
createUncoveredFileTransformer(ctx: Vitest): (filename: string) => Promise<TransformResult | null | undefined>;
|
|
116
118
|
}
|
|
117
119
|
|
package/dist/coverage.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { B as BaseCoverageProvider } from './chunks/coverage.
|
|
1
|
+
export { B as BaseCoverageProvider } from './chunks/coverage.tyqbzn4W.js';
|
|
2
2
|
import 'node:fs';
|
|
3
|
+
import 'node:module';
|
|
3
4
|
import 'node:path';
|
|
5
|
+
import 'node:url';
|
|
4
6
|
import '@vitest/utils/helpers';
|
|
5
7
|
import 'pathe';
|
|
6
8
|
import 'picomatch';
|
|
@@ -11,13 +13,14 @@ import 'node:os';
|
|
|
11
13
|
import './chunks/env.D4Lgay0q.js';
|
|
12
14
|
import 'std-env';
|
|
13
15
|
import 'node:crypto';
|
|
14
|
-
import '
|
|
15
|
-
import 'node:module';
|
|
16
|
+
import './chunks/index.BCY_7LL2.js';
|
|
16
17
|
import 'node:process';
|
|
17
18
|
import 'node:fs/promises';
|
|
18
19
|
import 'node:assert';
|
|
19
20
|
import 'node:v8';
|
|
20
21
|
import 'node:util';
|
|
21
22
|
import 'vite';
|
|
22
|
-
import './chunks/constants.
|
|
23
|
+
import './chunks/constants.B63TT-Bl.js';
|
|
23
24
|
import './chunks/coverage.D_JHT54q.js';
|
|
25
|
+
|
|
26
|
+
console.warn("Importing from \"vitest/coverage\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
|
package/dist/environments.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.
|
|
2
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
3
|
-
import './chunks/global.d.
|
|
1
|
+
import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.BE4kbYok.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.BE4kbYok.js';
|
|
3
|
+
import './chunks/global.d.JeWMqlOm.js';
|
|
4
4
|
import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated } from '@vitest/runner';
|
|
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, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
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, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, VitestRunnerConfig as TestRunnerConfig, TestTags, VitestRunner as VitestTestRunner, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
6
6
|
import { Awaitable } from '@vitest/utils';
|
|
7
7
|
export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
8
|
-
import { b as BirpcReturn } from './chunks/worker.d.
|
|
9
|
-
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
10
|
-
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.
|
|
11
|
-
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.
|
|
12
|
-
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.
|
|
13
|
-
export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.
|
|
8
|
+
import { b as BirpcReturn } from './chunks/worker.d.CPzI2ZzJ.js';
|
|
9
|
+
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.CPzI2ZzJ.js';
|
|
10
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.Cr1Ep39N.js';
|
|
11
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.Cr1Ep39N.js';
|
|
12
|
+
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.CM7x9-sm.js';
|
|
13
|
+
export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.CM7x9-sm.js';
|
|
14
14
|
import { ExpectStatic } from '@vitest/expect';
|
|
15
|
-
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers, chai } from '@vitest/expect';
|
|
15
|
+
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, RawMatcherFn as Matcher, ExpectationResult as MatcherResult, MatcherState, Matchers, chai } from '@vitest/expect';
|
|
16
16
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
17
17
|
export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
18
|
+
import { ModuleMockFactoryWithHelper, ModuleMockOptions } from '@vitest/mocker';
|
|
18
19
|
export { b as bench } from './chunks/suite.d.BJWk38HB.js';
|
|
19
20
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
21
|
+
export { NodeBenchmarkRunner as BenchmarkRunner, VitestTestRunner as TestRunner } from './runners.js';
|
|
20
22
|
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
|
|
21
23
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
22
24
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
@@ -98,12 +100,6 @@ declare const should: () => Chai.Should;
|
|
|
98
100
|
*/
|
|
99
101
|
declare function inject<T extends keyof ProvidedContext & string>(key: T): ProvidedContext[T];
|
|
100
102
|
|
|
101
|
-
type Promisable<T> = T | Promise<T>;
|
|
102
|
-
type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Promisable<Partial<M>>;
|
|
103
|
-
interface MockOptions {
|
|
104
|
-
spy?: boolean;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
103
|
type WaitForCallback<T> = () => T | Promise<T>;
|
|
108
104
|
interface WaitForOptions {
|
|
109
105
|
/**
|
|
@@ -203,6 +199,15 @@ interface VitestUtils {
|
|
|
203
199
|
*/
|
|
204
200
|
clearAllTimers: () => VitestUtils;
|
|
205
201
|
/**
|
|
202
|
+
* Controls how fake timers are advanced.
|
|
203
|
+
* @param mode The mode to use for advancing timers.
|
|
204
|
+
* - `manual`: The default behavior. Timers will only advance when you call one of `vi.advanceTimers...()` methods.
|
|
205
|
+
* - `nextTimerAsync`: Timers will be advanced automatically to the next available timer after each macrotask.
|
|
206
|
+
* - `interval`: Timers are advanced automatically by a specified interval.
|
|
207
|
+
* @param interval The interval in milliseconds to use when `mode` is `'interval'`.
|
|
208
|
+
*/
|
|
209
|
+
setTimerTickMode: ((mode: "manual" | "nextTimerAsync") => VitestUtils) & ((mode: "interval", interval?: number) => VitestUtils);
|
|
210
|
+
/**
|
|
206
211
|
* Creates a spy on a method or getter/setter of an object similar to [`vi.fn()`](https://vitest.dev/api/vi#vi-fn). It returns a [mock function](https://vitest.dev/api/mock).
|
|
207
212
|
* @example
|
|
208
213
|
* ```ts
|
|
@@ -296,8 +301,8 @@ interface VitestUtils {
|
|
|
296
301
|
* @param path Path to the module. Can be aliased, if your Vitest config supports it
|
|
297
302
|
* @param factory Mocked module factory. The result of this function will be an exports object
|
|
298
303
|
*/
|
|
299
|
-
mock(path: string, factory?:
|
|
300
|
-
mock<T>(module: Promise<T>, factory?:
|
|
304
|
+
mock(path: string, factory?: ModuleMockFactoryWithHelper | ModuleMockOptions): void;
|
|
305
|
+
mock<T>(module: Promise<T>, factory?: ModuleMockFactoryWithHelper<T> | ModuleMockOptions): void;
|
|
301
306
|
/**
|
|
302
307
|
* Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.
|
|
303
308
|
*
|
|
@@ -314,9 +319,11 @@ interface VitestUtils {
|
|
|
314
319
|
* Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).
|
|
315
320
|
* @param path Path to the module. Can be aliased, if your Vitest config supports it
|
|
316
321
|
* @param factory Mocked module factory. The result of this function will be an exports object
|
|
322
|
+
*
|
|
323
|
+
* @returns A disposable object that calls {@link doUnmock()} when disposed
|
|
317
324
|
*/
|
|
318
|
-
doMock(path: string, factory?:
|
|
319
|
-
doMock<T>(module: Promise<T>, factory?:
|
|
325
|
+
doMock(path: string, factory?: ModuleMockFactoryWithHelper | ModuleMockOptions): Disposable;
|
|
326
|
+
doMock<T>(module: Promise<T>, factory?: ModuleMockFactoryWithHelper<T> | ModuleMockOptions): Disposable;
|
|
320
327
|
/**
|
|
321
328
|
* Removes module from mocked registry. All subsequent calls to import will return original module.
|
|
322
329
|
*
|
|
@@ -387,12 +394,12 @@ interface VitestUtils {
|
|
|
387
394
|
* @param value - The object to be mocked
|
|
388
395
|
* @returns A deeply mocked version of the input object
|
|
389
396
|
*/
|
|
390
|
-
mockObject: <T>(value: T, options?:
|
|
397
|
+
mockObject: <T>(value: T, options?: ModuleMockOptions) => MaybeMockedDeep<T>;
|
|
391
398
|
/**
|
|
392
399
|
* Type helper for TypeScript. Just returns the object that was passed.
|
|
393
400
|
*
|
|
394
401
|
* When `partial` is `true` it will expect a `Partial<T>` as a return value. By default, this will only make TypeScript believe that
|
|
395
|
-
* the first level values are mocked. You can pass down `{ deep: true }`
|
|
402
|
+
* the first level values are mocked. You can pass down `{ partial: true, deep: true }` to make nested objects also partial recursively.
|
|
396
403
|
* @example
|
|
397
404
|
* ```ts
|
|
398
405
|
* import example from './example.js'
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { b as bench } from './chunks/benchmark.
|
|
1
|
+
export { N as BenchmarkRunner, T as TestRunner, a as assert, c as createExpect, g as expect, i as inject, s as should, v as vi, b as vitest } from './chunks/test.G82XYNFk.js';
|
|
2
|
+
export { b as bench } from './chunks/benchmark.BoqSLF53.js';
|
|
3
3
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.Dg1zASAC.js';
|
|
4
|
-
export { a as assertType } from './chunks/index.
|
|
4
|
+
export { a as assertType } from './chunks/index.CouFDptX.js';
|
|
5
5
|
export { expectTypeOf } from 'expect-type';
|
|
6
6
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';
|
|
7
7
|
export { chai } from '@vitest/expect';
|
|
8
|
-
import '
|
|
8
|
+
import '@vitest/utils/helpers';
|
|
9
9
|
import '@vitest/utils/timers';
|
|
10
|
+
import './chunks/utils.DT4VyRyl.js';
|
|
10
11
|
import '@vitest/runner/utils';
|
|
11
|
-
import '@vitest/snapshot';
|
|
12
12
|
import '@vitest/utils/error';
|
|
13
|
-
import '
|
|
13
|
+
import 'pathe';
|
|
14
|
+
import '@vitest/snapshot';
|
|
14
15
|
import '@vitest/spy';
|
|
15
16
|
import '@vitest/utils/offset';
|
|
16
17
|
import '@vitest/utils/source-map';
|
|
17
18
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
18
|
-
import './chunks/
|
|
19
|
-
import '
|
|
19
|
+
import './chunks/rpc.DcRWTy5G.js';
|
|
20
|
+
import './chunks/index.Chj8NDwU.js';
|
|
20
21
|
import 'vite/module-runner';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
|
|
2
2
|
import { V as VitestEvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
3
3
|
import vm from 'node:vm';
|
|
4
|
-
import { R as RuntimeRPC } from './chunks/rpc.d.
|
|
4
|
+
import { R as RuntimeRPC } from './chunks/rpc.d.CM7x9-sm.js';
|
|
5
5
|
import '@vitest/runner';
|
|
6
6
|
import '@vitest/snapshot';
|
|
7
7
|
import './chunks/traces.d.402V_yFI.js';
|
|
@@ -82,6 +82,15 @@ declare module "vite/module-runner" {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
declare module "vite/module-runner" {
|
|
86
|
+
interface EvaluatedModuleNode {
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
mockedExports?: Record<string, any>;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
85
94
|
interface VitestVmOptions {
|
|
86
95
|
context: vm.Context;
|
|
87
96
|
externalModulesExecutor: ExternalModulesExecutor;
|
package/dist/module-evaluator.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isBuiltin, createRequire } from 'node:module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
3
3
|
import vm from 'node:vm';
|
|
4
|
-
import { isAbsolute } from 'pathe';
|
|
5
4
|
import { ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey } from 'vite/module-runner';
|
|
6
5
|
import { T as Traces } from './chunks/traces.CCmnQaNT.js';
|
|
7
6
|
|
|
@@ -163,7 +162,7 @@ class VitestModuleEvaluator {
|
|
|
163
162
|
const filename = meta.filename;
|
|
164
163
|
const dirname = meta.dirname;
|
|
165
164
|
span.setAttributes({ "code.file.path": filename });
|
|
166
|
-
const require = this.createRequire(
|
|
165
|
+
const require = this.createRequire(meta.url);
|
|
167
166
|
const argumentsList = [
|
|
168
167
|
ssrModuleExportsKey,
|
|
169
168
|
ssrImportMetaKey,
|
|
@@ -220,9 +219,6 @@ class VitestModuleEvaluator {
|
|
|
220
219
|
}
|
|
221
220
|
}
|
|
222
221
|
createRequire(filename) {
|
|
223
|
-
// \x00 is a rollup convention for virtual files,
|
|
224
|
-
// it is not allowed in actual file names
|
|
225
|
-
if (filename[0] === "\0" || !isAbsolute(filename)) return () => ({});
|
|
226
222
|
return this.vm ? this.vm.externalModulesExecutor.createRequire(filename) : createRequire(filename);
|
|
227
223
|
}
|
|
228
224
|
shouldInterop(path, mod) {
|
package/dist/node.d.ts
CHANGED
|
@@ -3,25 +3,23 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
8
|
-
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.
|
|
6
|
+
import { f as ResolvedConfig, d as UserConfig, g as VitestRunMode, h as VitestOptions, V as Vitest, A as ApiConfig, i as TestSpecification, T as TestProject, P as PoolWorker, j as PoolOptions, k as WorkerRequest, l as TestSequencer, L as Logger } from './chunks/reporters.d.7faYdkxy.js';
|
|
7
|
+
export { aP as BaseCoverageOptions, z as BaseReporter, E as BenchmarkBuiltinReporters, B as BenchmarkReporter, r as BenchmarkReportsMap, ai as BenchmarkUserOptions, ak as BrowserBuiltinProvider, al as BrowserCommand, am as BrowserCommandContext, an as BrowserConfigOptions, ao as BrowserInstanceOption, ap as BrowserModuleMocker, aq as BrowserOrchestrator, ar as BrowserProvider, as as BrowserProviderOption, at as BrowserScript, au as BrowserServerFactory, av as BrowserServerOptions, aw as BrowserServerState, ax as BrowserServerStateSession, aE as BuiltinEnvironment, F as BuiltinReporterOptions, K as BuiltinReporters, ay as CDPSession, aF as CSSModuleScopeStrategy, aQ as CoverageIstanbulOptions, aR as CoverageOptions, aS as CoverageProvider, aT as CoverageProviderModule, aU as CoverageReporter, C as CoverageV8Options, aV as CustomProviderOptions, D as DefaultReporter, aG as DepsOptimizationOptions, s as DotReporter, aH as EnvironmentOptions, G as GithubActionsReporter, _ as HTMLOptions, H as HangingProcessReporter, I as InlineConfig, a0 as JUnitOptions, t as JUnitReporter, M as JsonAssertionResult, $ as JsonOptions, J as JsonReporter, N as JsonTestResult, Q as JsonTestResults, a1 as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, az as ParentProjectBrowser, aI as Pool, o as PoolRunnerInitializer, p as PoolTask, aA as ProjectBrowser, aJ as ProjectConfig, aW as ReportContext, X as ReportedHookContext, Y as Reporter, u as ReportersMap, aL as ResolveSnapshotPathHandler, aM as ResolveSnapshotPathHandlerContext, aB as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aK as ResolvedProjectConfig, S as SerializedTestProject, v as TapFlatReporter, w as TapReporter, a2 as TaskOptions, a3 as TestCase, a4 as TestCollection, a5 as TestDiagnostic, a6 as TestModule, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, Z as TestRunEndReason, aX as TestRunResult, ag as TestSequencerConstructor, ah as TestSpecificationOptions, ac as TestState, ad as TestSuite, ae as TestSuiteState, aC as ToMatchScreenshotComparators, aD as ToMatchScreenshotOptions, aN as TypecheckConfig, U as UserWorkspaceConfig, x as VerboseBenchmarkReporter, y as VerboseReporter, aO as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, q as WorkerResponse, aj as _BrowserNames, af as experimental_getRunnerTask } from './chunks/reporters.d.7faYdkxy.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.C9o5bttz.js';
|
|
9
|
+
export { BaseCoverageProvider } from './coverage.js';
|
|
9
10
|
import { Awaitable } from '@vitest/utils';
|
|
10
11
|
export { SerializedError } from '@vitest/utils';
|
|
11
|
-
import { R as RuntimeRPC } from './chunks/rpc.d.
|
|
12
|
+
import { R as RuntimeRPC } from './chunks/rpc.d.CM7x9-sm.js';
|
|
12
13
|
import { Writable } from 'node:stream';
|
|
13
|
-
import { C as ContextRPC } from './chunks/worker.d.
|
|
14
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
14
|
+
import { C as ContextRPC } from './chunks/worker.d.CPzI2ZzJ.js';
|
|
15
|
+
export { T as TestExecutionType } from './chunks/worker.d.CPzI2ZzJ.js';
|
|
15
16
|
import { Debugger } from 'obug';
|
|
16
|
-
import './chunks/global.d.
|
|
17
|
+
import './chunks/global.d.JeWMqlOm.js';
|
|
17
18
|
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.
|
|
19
|
+
export { b as RuntimeConfig } from './chunks/config.d.Cr1Ep39N.js';
|
|
19
20
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
20
|
-
import './chunks/browser.d.
|
|
21
|
+
import './chunks/browser.d.BE4kbYok.js';
|
|
21
22
|
import './chunks/traces.d.402V_yFI.js';
|
|
22
|
-
import '@vitest/mocker';
|
|
23
|
-
import '@vitest/utils/source-map';
|
|
24
|
-
import 'vitest/browser';
|
|
25
23
|
import '@vitest/pretty-format';
|
|
26
24
|
import '@vitest/snapshot';
|
|
27
25
|
import '@vitest/utils/diff';
|
|
@@ -29,6 +27,9 @@ import '@vitest/expect';
|
|
|
29
27
|
import 'vitest/optional-types.js';
|
|
30
28
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
31
29
|
import 'tinybench';
|
|
30
|
+
import '@vitest/mocker';
|
|
31
|
+
import '@vitest/utils/source-map';
|
|
32
|
+
import 'vitest/browser';
|
|
32
33
|
import './chunks/coverage.d.BZtK59WP.js';
|
|
33
34
|
import '@vitest/snapshot/manager';
|
|
34
35
|
import 'node:console';
|
package/dist/node.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.
|
|
5
|
-
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, p as createDebugger, d as createMethodsRPC, o as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, n as isFileServingAllowed, i as isValidApiRequest, m 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, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.ChbI1JU9.js';
|
|
5
|
+
export { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, p as createDebugger, d as createMethodsRPC, o as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, n as isFileServingAllowed, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.ChbI1JU9.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.C4jjt2RX.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.tyqbzn4W.js';
|
|
8
|
+
export { B as BaseCoverageProvider, b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.tyqbzn4W.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils/helpers';
|
|
10
10
|
import { a as any } from './chunks/index.D4KonVSU.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
12
|
-
import { c as configFiles } from './chunks/constants.
|
|
12
|
+
import { c as configFiles } from './chunks/constants.B63TT-Bl.js';
|
|
13
|
+
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.B-iBE_Gx.js';
|
|
13
14
|
export { distDir, rootDir } from './path.js';
|
|
14
15
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
16
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.CFulQRmC.js';
|
|
15
17
|
import 'node:fs';
|
|
16
18
|
import './chunks/coverage.D_JHT54q.js';
|
|
17
19
|
import 'node:path';
|
|
20
|
+
import './chunks/index.BCY_7LL2.js';
|
|
21
|
+
import 'node:module';
|
|
22
|
+
import 'node:process';
|
|
23
|
+
import 'node:fs/promises';
|
|
24
|
+
import 'node:url';
|
|
25
|
+
import 'node:assert';
|
|
26
|
+
import 'node:v8';
|
|
27
|
+
import 'node:util';
|
|
18
28
|
import 'node:os';
|
|
19
29
|
import '@vitest/snapshot/manager';
|
|
20
30
|
import 'node:perf_hooks';
|
|
21
31
|
import './chunks/index.Chj8NDwU.js';
|
|
22
|
-
import './chunks/index.M8mOzt4Y.js';
|
|
23
|
-
import 'node:fs/promises';
|
|
24
|
-
import '@vitest/utils/source-map';
|
|
25
|
-
import 'tinyrainbow';
|
|
26
|
-
import './chunks/env.D4Lgay0q.js';
|
|
27
|
-
import 'std-env';
|
|
28
|
-
import 'node:util';
|
|
29
|
-
import 'node:console';
|
|
30
|
-
import 'node:stream';
|
|
31
|
-
import '@vitest/utils/display';
|
|
32
|
-
import 'tinyexec';
|
|
33
|
-
import '@vitest/utils/offset';
|
|
34
|
-
import 'node:module';
|
|
35
32
|
import 'events';
|
|
36
33
|
import 'https';
|
|
37
34
|
import 'http';
|
|
@@ -44,12 +41,16 @@ import 'zlib';
|
|
|
44
41
|
import 'buffer';
|
|
45
42
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
46
43
|
import 'node:crypto';
|
|
44
|
+
import './chunks/nativeModuleRunner.BIakptoF.js';
|
|
45
|
+
import 'vite/module-runner';
|
|
47
46
|
import './chunks/traces.CCmnQaNT.js';
|
|
48
47
|
import 'obug';
|
|
48
|
+
import 'tinyrainbow';
|
|
49
49
|
import '#module-evaluator';
|
|
50
|
-
import '
|
|
50
|
+
import 'node:console';
|
|
51
51
|
import '@vitest/utils/highlight';
|
|
52
|
-
import '
|
|
52
|
+
import './chunks/env.D4Lgay0q.js';
|
|
53
|
+
import 'std-env';
|
|
53
54
|
import 'node:tty';
|
|
54
55
|
import 'node:events';
|
|
55
56
|
import './chunks/modules.BJuCwlRJ.js';
|
|
@@ -63,13 +64,14 @@ import './chunks/defaults.BOqNVLsY.js';
|
|
|
63
64
|
import '@vitest/utils/constants';
|
|
64
65
|
import '@vitest/utils/resolver';
|
|
65
66
|
import 'es-module-lexer';
|
|
66
|
-
import './chunks/index.C5r1PdPD.js';
|
|
67
|
-
import 'node:assert';
|
|
68
67
|
import '@vitest/utils/serialize';
|
|
68
|
+
import '@vitest/utils/source-map';
|
|
69
69
|
import 'node:readline';
|
|
70
|
-
import 'node:process';
|
|
71
|
-
import 'node:v8';
|
|
72
70
|
import 'readline';
|
|
71
|
+
import 'node:stream';
|
|
72
|
+
import '@vitest/utils/display';
|
|
73
|
+
import 'tinyexec';
|
|
74
|
+
import '@vitest/utils/offset';
|
|
73
75
|
|
|
74
76
|
// this is only exported as a public function and not used inside vitest
|
|
75
77
|
async function resolveConfig(options = {}, viteOverrides = {}) {
|