vitest 4.0.12 → 4.0.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/dist/browser.d.ts +7 -10
- package/dist/chunks/{base.CDEiaaLz.js → base.Dqf2QAxh.js} +2 -2
- package/dist/chunks/{browser.d.Bq3zc1l_.d.ts → browser.d.CDvMh6F9.d.ts} +1 -1
- package/dist/chunks/{cac.D9QaLeSz.js → cac.L-UbQ_Ix.js} +3 -3
- package/dist/chunks/{cli-api.BJh-POxZ.js → cli-api.CdZ6wo9-.js} +58 -56
- package/dist/chunks/{traces.d.Brik_NWu.d.ts → config.d.g6OOauRt.d.ts} +1 -18
- package/dist/chunks/{global.d.Dheepru6.d.ts → global.d.B15mdLcR.d.ts} +1 -1
- package/dist/chunks/{init-forks.FphdQhPI.js → init-forks.CglOH45c.js} +1 -1
- package/dist/chunks/{init-threads.BfqfWDNi.js → init-threads.BuMdIy1r.js} +1 -1
- package/dist/chunks/{init.D-GGeAxo.js → init.MkYs5nmh.js} +1 -1
- package/dist/chunks/{plugin.d.DGpEw-QV.d.ts → plugin.d.B4l3vYM_.d.ts} +1 -1
- package/dist/chunks/{reporters.d.C2PtoEFY.d.ts → reporters.d.J2RlBlp9.d.ts} +5 -3
- package/dist/chunks/rpc.d.RH3apGEf.d.ts +64 -0
- package/dist/chunks/{startModuleRunner.BEYtrq5Y.js → startModuleRunner.W28wBIgJ.js} +3 -0
- package/dist/chunks/traces.d.402V_yFI.d.ts +18 -0
- package/dist/chunks/{vm.tWlKAMXr.js → vm.Y19jrZy2.js} +2 -2
- package/dist/chunks/{worker.d.Dxl5oW0C.d.ts → worker.d.DCy61tzi.d.ts} +5 -63
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +10 -8
- package/dist/coverage.d.ts +8 -6
- package/dist/index.d.ts +16 -9
- package/dist/module-evaluator.d.ts +117 -12
- package/dist/module-runner.js +1 -1
- package/dist/node.d.ts +10 -8
- package/dist/node.js +3 -3
- package/dist/reporters.d.ts +10 -8
- package/dist/runners.d.ts +2 -1
- package/dist/worker.d.ts +6 -4
- package/dist/worker.js +3 -3
- package/dist/workers/forks.js +4 -4
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +4 -4
- package/dist/workers/vmThreads.js +4 -4
- package/package.json +12 -12
- package/dist/chunks/mocker.d.BE_2ls6u.d.ts +0 -17
- package/dist/chunks/moduleRunner.d.RBEiFdiW.d.ts +0 -204
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
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.CDvMh6F9.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.CDvMh6F9.js';
|
|
3
|
+
import './chunks/global.d.B15mdLcR.js';
|
|
4
4
|
import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated } from '@vitest/runner';
|
|
5
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';
|
|
6
6
|
import { Awaitable } from '@vitest/utils';
|
|
7
7
|
export { ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
10
|
-
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/
|
|
11
|
-
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/
|
|
8
|
+
import { b as BirpcReturn } from './chunks/worker.d.DCy61tzi.js';
|
|
9
|
+
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.DCy61tzi.js';
|
|
10
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.g6OOauRt.js';
|
|
11
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.g6OOauRt.js';
|
|
12
|
+
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.RH3apGEf.js';
|
|
13
|
+
export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
12
14
|
import { ExpectStatic } from '@vitest/expect';
|
|
13
15
|
export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers, chai } from '@vitest/expect';
|
|
14
16
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
15
17
|
export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
16
|
-
import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
|
|
17
18
|
export { b as bench } from './chunks/suite.d.BJWk38HB.js';
|
|
18
19
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
19
20
|
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
|
|
@@ -23,7 +24,7 @@ export { DiffOptions } from '@vitest/utils/diff';
|
|
|
23
24
|
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
24
25
|
import '@vitest/pretty-format';
|
|
25
26
|
import './chunks/environment.d.CrsxCzP1.js';
|
|
26
|
-
import '
|
|
27
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
27
28
|
import '@vitest/runner/utils';
|
|
28
29
|
|
|
29
30
|
interface SourceMap {
|
|
@@ -89,6 +90,12 @@ declare const should: () => Chai.Should;
|
|
|
89
90
|
*/
|
|
90
91
|
declare function inject<T extends keyof ProvidedContext & string>(key: T): ProvidedContext[T];
|
|
91
92
|
|
|
93
|
+
type Promisable<T> = T | Promise<T>;
|
|
94
|
+
type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Promisable<Partial<M>>;
|
|
95
|
+
interface MockOptions {
|
|
96
|
+
spy?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
92
99
|
type WaitForCallback<T> = () => T | Promise<T>;
|
|
93
100
|
interface WaitForOptions {
|
|
94
101
|
/**
|
|
@@ -1,14 +1,119 @@
|
|
|
1
|
-
import 'vite/module-runner';
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
import '@vitest/spy';
|
|
5
|
-
import './chunks/worker.d.Dxl5oW0C.js';
|
|
1
|
+
import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
|
|
2
|
+
import vm from 'node:vm';
|
|
3
|
+
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
6
4
|
import '@vitest/runner';
|
|
7
|
-
import './chunks/traces.d.Brik_NWu.js';
|
|
8
|
-
import '@vitest/pretty-format';
|
|
9
5
|
import '@vitest/snapshot';
|
|
10
|
-
import '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
7
|
+
|
|
8
|
+
type ModuleExecutionInfo = Map<string, ModuleExecutionInfoEntry>;
|
|
9
|
+
interface ModuleExecutionInfoEntry {
|
|
10
|
+
startOffset: number;
|
|
11
|
+
/** The duration that was spent executing the module. */
|
|
12
|
+
duration: number;
|
|
13
|
+
/** The time that was spent executing the module itself and externalized imports. */
|
|
14
|
+
selfTime: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class FileMap {
|
|
18
|
+
private fsCache;
|
|
19
|
+
private fsBufferCache;
|
|
20
|
+
readFileAsync(path: string): Promise<string>;
|
|
21
|
+
readFile(path: string): string;
|
|
22
|
+
readBuffer(path: string): Buffer<ArrayBuffer>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ModuleEvaluateOptions {
|
|
26
|
+
timeout?: vm.RunningScriptOptions["timeout"] | undefined;
|
|
27
|
+
breakOnSigint?: vm.RunningScriptOptions["breakOnSigint"] | undefined;
|
|
28
|
+
}
|
|
29
|
+
type ModuleLinker = (specifier: string, referencingModule: VMModule, extra: {
|
|
30
|
+
assert: object;
|
|
31
|
+
}) => VMModule | Promise<VMModule>;
|
|
32
|
+
type ModuleStatus = "unlinked" | "linking" | "linked" | "evaluating" | "evaluated" | "errored";
|
|
33
|
+
declare class VMModule {
|
|
34
|
+
dependencySpecifiers: readonly string[];
|
|
35
|
+
error: any;
|
|
36
|
+
identifier: string;
|
|
37
|
+
context: vm.Context;
|
|
38
|
+
namespace: object;
|
|
39
|
+
status: ModuleStatus;
|
|
40
|
+
evaluate(options?: ModuleEvaluateOptions): Promise<void>;
|
|
41
|
+
link(linker: ModuleLinker): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface ExternalModulesExecutorOptions {
|
|
45
|
+
context: vm.Context;
|
|
46
|
+
fileMap: FileMap;
|
|
47
|
+
packageCache: Map<string, any>;
|
|
48
|
+
transform: RuntimeRPC["transform"];
|
|
49
|
+
interopDefault?: boolean;
|
|
50
|
+
viteClientModule: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
declare class ExternalModulesExecutor {
|
|
53
|
+
#private;
|
|
54
|
+
private options;
|
|
55
|
+
private cjs;
|
|
56
|
+
private esm;
|
|
57
|
+
private vite;
|
|
58
|
+
private context;
|
|
59
|
+
private fs;
|
|
60
|
+
private resolvers;
|
|
61
|
+
constructor(options: ExternalModulesExecutorOptions);
|
|
62
|
+
import(identifier: string): Promise<object>;
|
|
63
|
+
require(identifier: string): any;
|
|
64
|
+
createRequire(identifier: string): NodeJS.Require;
|
|
65
|
+
importModuleDynamically: (specifier: string, referencer: VMModule) => Promise<VMModule>;
|
|
66
|
+
resolveModule: (specifier: string, referencer: string) => Promise<VMModule>;
|
|
67
|
+
resolve(specifier: string, parent: string): string;
|
|
68
|
+
private getModuleInformation;
|
|
69
|
+
private createModule;
|
|
70
|
+
private get isNetworkSupported();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare module "vite/module-runner" {
|
|
74
|
+
interface EvaluatedModuleNode {
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
mockedExports?: Record<string, any>;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface VitestVmOptions {
|
|
83
|
+
context: vm.Context;
|
|
84
|
+
externalModulesExecutor: ExternalModulesExecutor;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface VitestModuleEvaluatorOptions {
|
|
88
|
+
interopDefault?: boolean | undefined;
|
|
89
|
+
moduleExecutionInfo?: ModuleExecutionInfo;
|
|
90
|
+
getCurrentTestFilepath?: () => string | undefined;
|
|
91
|
+
compiledFunctionArgumentsNames?: string[];
|
|
92
|
+
compiledFunctionArgumentsValues?: unknown[];
|
|
93
|
+
}
|
|
94
|
+
declare class VitestModuleEvaluator implements ModuleEvaluator {
|
|
95
|
+
private options;
|
|
96
|
+
stubs: Record<string, any>;
|
|
97
|
+
env: ModuleRunnerImportMeta["env"];
|
|
98
|
+
private vm;
|
|
99
|
+
private compiledFunctionArgumentsNames?;
|
|
100
|
+
private compiledFunctionArgumentsValues;
|
|
101
|
+
private primitives;
|
|
102
|
+
private debug;
|
|
103
|
+
private _otel;
|
|
104
|
+
constructor(vmOptions?: VitestVmOptions | undefined, options?: VitestModuleEvaluatorOptions);
|
|
105
|
+
private convertIdToImportUrl;
|
|
106
|
+
runExternalModule(id: string): Promise<any>;
|
|
107
|
+
runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
|
|
108
|
+
private _runInlinedModule;
|
|
109
|
+
private createRequire;
|
|
110
|
+
private shouldInterop;
|
|
111
|
+
}
|
|
112
|
+
declare function createImportMetaEnvProxy(): ModuleRunnerImportMeta["env"];
|
|
113
|
+
declare function getDefaultRequestStubs(context?: vm.Context): Record<string, any>;
|
|
114
|
+
declare function isPrimitive(v: any): boolean;
|
|
115
|
+
declare function wrapId(id: string): string;
|
|
116
|
+
declare function unwrapId(id: string): string;
|
|
117
|
+
|
|
118
|
+
export { VitestModuleEvaluator, createImportMetaEnvProxy, getDefaultRequestStubs, isPrimitive, unwrapId, wrapId };
|
|
119
|
+
export type { VitestModuleEvaluatorOptions };
|
package/dist/module-runner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.
|
|
2
|
+
export { a as VITEST_VM_CONTEXT_SYMBOL, V as VitestModuleRunner, s as startVitestModuleRunner } from './chunks/startModuleRunner.W28wBIgJ.js';
|
|
3
3
|
export { g as getWorkerState } from './chunks/utils.DvEY5TfP.js';
|
|
4
4
|
import 'node:module';
|
|
5
5
|
import 'node:url';
|
package/dist/node.d.ts
CHANGED
|
@@ -3,28 +3,30 @@ 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 PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.
|
|
7
|
-
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.
|
|
8
|
-
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.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 PoolWorker, l as PoolOptions, m as WorkerRequest, n as TestSequencer, L as Logger } from './chunks/reporters.d.J2RlBlp9.js';
|
|
7
|
+
export { at as BaseCoverageOptions, Y as BenchmarkUserOptions, Z as BrowserBuiltinProvider, $ as BrowserCommand, a0 as BrowserCommandContext, a1 as BrowserConfigOptions, a2 as BrowserInstanceOption, a3 as BrowserModuleMocker, a4 as BrowserOrchestrator, a5 as BrowserProvider, a6 as BrowserProviderOption, a7 as BrowserScript, a8 as BrowserServerFactory, a9 as BrowserServerOptions, aa as BrowserServerState, ab as BrowserServerStateSession, ai as BuiltinEnvironment, ac as CDPSession, aj as CSSModuleScopeStrategy, au as CoverageIstanbulOptions, av as CoverageOptions, aw as CoverageProvider, ax as CoverageProviderModule, ay as CoverageReporter, c as CoverageV8Options, az as CustomProviderOptions, ak as DepsOptimizationOptions, al as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, t as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, o as OnTestsRerunHandler, ad as ParentProjectBrowser, am as Pool, q as PoolRunnerInitializer, r as PoolTask, ae as ProjectBrowser, an as ProjectConfig, a as ReportContext, aB as ReportedHookContext, aC as Reporter, ap as ResolveSnapshotPathHandler, aq as ResolveSnapshotPathHandlerContext, af as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ao as ResolvedProjectConfig, S as SerializedTestProject, u as TaskOptions, v as TestCase, w as TestCollection, x as TestDiagnostic, y as TestModule, z as TestModuleState, B as TestResult, D as TestResultFailed, E as TestResultPassed, F as TestResultSkipped, aD as TestRunEndReason, aA as TestRunResult, X as TestSequencerConstructor, G as TestState, K as TestSuite, N as TestSuiteState, ag as ToMatchScreenshotComparators, ah as ToMatchScreenshotOptions, ar as TypecheckConfig, U as UserWorkspaceConfig, as as VitestEnvironment, p as VitestPackageInstaller, W as WatcherTriggerPattern, s as WorkerResponse, _ as _BrowserNames, Q as experimental_getRunnerTask } from './chunks/reporters.d.J2RlBlp9.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.B4l3vYM_.js';
|
|
9
9
|
import { Awaitable } from '@vitest/utils';
|
|
10
10
|
export { SerializedError } from '@vitest/utils';
|
|
11
|
-
import { R as RuntimeRPC
|
|
12
|
-
export { T as TestExecutionType } from './chunks/worker.d.Dxl5oW0C.js';
|
|
11
|
+
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
13
12
|
import { Writable } from 'node:stream';
|
|
13
|
+
import { C as ContextRPC } from './chunks/worker.d.DCy61tzi.js';
|
|
14
|
+
export { T as TestExecutionType } from './chunks/worker.d.DCy61tzi.js';
|
|
14
15
|
import { Debugger } from 'debug';
|
|
15
|
-
import './chunks/global.d.
|
|
16
|
+
import './chunks/global.d.B15mdLcR.js';
|
|
16
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';
|
|
17
|
-
export { b as RuntimeConfig } from './chunks/
|
|
18
|
+
export { b as RuntimeConfig } from './chunks/config.d.g6OOauRt.js';
|
|
18
19
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
20
|
import '@vitest/mocker';
|
|
20
21
|
import '@vitest/utils/source-map';
|
|
21
22
|
import 'vitest/browser';
|
|
22
|
-
import './chunks/browser.d.
|
|
23
|
+
import './chunks/browser.d.CDvMh6F9.js';
|
|
23
24
|
import '@vitest/pretty-format';
|
|
24
25
|
import '@vitest/snapshot';
|
|
25
26
|
import '@vitest/utils/diff';
|
|
26
27
|
import '@vitest/expect';
|
|
27
28
|
import 'vitest/optional-types.js';
|
|
29
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
28
30
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
29
31
|
import 'tinybench';
|
|
30
32
|
import './chunks/coverage.d.BZtK59WP.js';
|
package/dist/node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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 { f as ForksPoolWorker, G as GitNotFoundError, F as TestsNotFoundError, T as ThreadsPoolWorker, h as TypecheckPoolWorker, b as VitestPackageInstaller, j as VmForksPoolWorker, k as VmThreadsPoolWorker, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.CdZ6wo9-.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, o as createDebugger, d as createMethodsRPC, n as createViteLogger, c as createVitest, e as escapeTestName, l as experimental_getRunnerTask, g as getFilePoolName, i as isValidApiRequest, m as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.CdZ6wo9-.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.L-UbQ_Ix.js';
|
|
7
7
|
import { r as resolveConfig$2 } from './chunks/coverage.CtyeYmKM.js';
|
|
8
8
|
export { b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.CtyeYmKM.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils/helpers';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.
|
|
1
|
+
export { aR as BaseReporter, aS as BenchmarkBuiltinReporters, aE as BenchmarkReporter, aF as BenchmarkReportsMap, aT as BuiltinReporterOptions, aU as BuiltinReporters, aG as DefaultReporter, aH as DotReporter, aI as GithubActionsReporter, aJ as HangingProcessReporter, aL as JUnitReporter, aV as JsonAssertionResult, aK as JsonReporter, aW as JsonTestResult, aX as JsonTestResults, aB as ReportedHookContext, aC as Reporter, aM as ReportersMap, aN as TapFlatReporter, aO as TapReporter, aD as TestRunEndReason, aP as VerboseBenchmarkReporter, aQ as VerboseReporter } from './chunks/reporters.d.J2RlBlp9.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils';
|
|
4
|
-
import './chunks/
|
|
5
|
-
import 'vite/module-runner';
|
|
6
|
-
import './chunks/traces.d.Brik_NWu.js';
|
|
7
|
-
import '@vitest/pretty-format';
|
|
4
|
+
import './chunks/rpc.d.RH3apGEf.js';
|
|
8
5
|
import '@vitest/snapshot';
|
|
9
|
-
import '
|
|
10
|
-
import './chunks/
|
|
6
|
+
import 'vite/module-runner';
|
|
7
|
+
import './chunks/traces.d.402V_yFI.js';
|
|
11
8
|
import 'node:stream';
|
|
12
9
|
import 'vite';
|
|
13
10
|
import '@vitest/mocker';
|
|
14
11
|
import '@vitest/utils/source-map';
|
|
15
12
|
import 'vitest/browser';
|
|
16
|
-
import './chunks/
|
|
13
|
+
import './chunks/config.d.g6OOauRt.js';
|
|
14
|
+
import '@vitest/pretty-format';
|
|
15
|
+
import '@vitest/utils/diff';
|
|
16
|
+
import './chunks/browser.d.CDvMh6F9.js';
|
|
17
|
+
import './chunks/worker.d.DCy61tzi.js';
|
|
18
|
+
import './chunks/environment.d.CrsxCzP1.js';
|
|
17
19
|
import '@vitest/expect';
|
|
18
20
|
import 'vitest/optional-types.js';
|
|
19
21
|
import './chunks/benchmark.d.DAaHLpsq.js';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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 { S as SerializedConfig
|
|
4
|
+
import { S as SerializedConfig } from './chunks/config.d.g6OOauRt.js';
|
|
5
|
+
import { T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
5
6
|
import '@vitest/pretty-format';
|
|
6
7
|
import '@vitest/snapshot';
|
|
7
8
|
import '@vitest/utils/diff';
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, B as BirpcOptions,
|
|
2
|
-
import { T as Traces } from './chunks/traces.d.
|
|
1
|
+
import { W as WorkerGlobalState, B as BirpcOptions, a as WorkerSetupContext } from './chunks/worker.d.DCy61tzi.js';
|
|
2
|
+
import { T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
|
+
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
4
5
|
import '@vitest/runner';
|
|
5
6
|
import 'vite/module-runner';
|
|
6
|
-
import './chunks/
|
|
7
|
-
import '@vitest/snapshot';
|
|
7
|
+
import './chunks/config.d.g6OOauRt.js';
|
|
8
8
|
import '@vitest/pretty-format';
|
|
9
|
+
import '@vitest/snapshot';
|
|
9
10
|
import '@vitest/utils/diff';
|
|
11
|
+
import './chunks/environment.d.CrsxCzP1.js';
|
|
10
12
|
|
|
11
13
|
/** @experimental */
|
|
12
14
|
declare function runBaseTests(method: "run" | "collect", state: WorkerGlobalState, traces: Traces): Promise<void>;
|
package/dist/worker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { r as runBaseTests } from './chunks/base.
|
|
2
|
-
export { i as init } from './chunks/init.
|
|
1
|
+
export { r as runBaseTests } from './chunks/base.Dqf2QAxh.js';
|
|
2
|
+
export { i as init } from './chunks/init.MkYs5nmh.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
5
|
import './chunks/index.CQwQ_SLL.js';
|
|
@@ -25,7 +25,7 @@ import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
|
25
25
|
import './chunks/date.Bq6ZW5rf.js';
|
|
26
26
|
import './chunks/evaluatedModules.Dg1zASAC.js';
|
|
27
27
|
import 'vite/module-runner';
|
|
28
|
-
import './chunks/startModuleRunner.
|
|
28
|
+
import './chunks/startModuleRunner.W28wBIgJ.js';
|
|
29
29
|
import 'node:fs';
|
|
30
30
|
import 'node:module';
|
|
31
31
|
import 'node:url';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as runBaseTests, s as setupEnvironment } from '../chunks/base.
|
|
2
|
-
import { w as workerInit } from '../chunks/init-forks.
|
|
1
|
+
import { r as runBaseTests, s as setupEnvironment } from '../chunks/base.Dqf2QAxh.js';
|
|
2
|
+
import { w as workerInit } from '../chunks/init-forks.CglOH45c.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
5
|
import '../chunks/index.CQwQ_SLL.js';
|
|
@@ -23,12 +23,12 @@ import '@vitest/utils/offset';
|
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
24
|
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
25
25
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
26
|
-
import '../chunks/init.
|
|
26
|
+
import '../chunks/init.MkYs5nmh.js';
|
|
27
27
|
import 'node:fs';
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import 'node:url';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import '../chunks/startModuleRunner.
|
|
31
|
+
import '../chunks/startModuleRunner.W28wBIgJ.js';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.
|
|
2
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
1
|
+
import { s as setupEnvironment, r as runBaseTests } from '../chunks/base.Dqf2QAxh.js';
|
|
2
|
+
import { w as workerInit } from '../chunks/init-threads.BuMdIy1r.js';
|
|
3
3
|
import 'node:vm';
|
|
4
4
|
import '@vitest/spy';
|
|
5
5
|
import '../chunks/index.CQwQ_SLL.js';
|
|
@@ -23,12 +23,12 @@ import '@vitest/utils/offset';
|
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
24
|
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
25
25
|
import '../chunks/date.Bq6ZW5rf.js';
|
|
26
|
-
import '../chunks/init.
|
|
26
|
+
import '../chunks/init.MkYs5nmh.js';
|
|
27
27
|
import 'node:fs';
|
|
28
28
|
import 'node:module';
|
|
29
29
|
import 'node:url';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import '../chunks/startModuleRunner.
|
|
31
|
+
import '../chunks/startModuleRunner.W28wBIgJ.js';
|
|
32
32
|
import '../path.js';
|
|
33
33
|
import 'node:path';
|
|
34
34
|
import '@vitest/utils/serialize';
|
package/dist/workers/vmForks.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-forks.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
3
|
-
import '../chunks/init.
|
|
1
|
+
import { w as workerInit } from '../chunks/init-forks.CglOH45c.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.Y19jrZy2.js';
|
|
3
|
+
import '../chunks/init.MkYs5nmh.js';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:module';
|
|
6
6
|
import 'node:url';
|
|
7
7
|
import 'pathe';
|
|
8
8
|
import 'vite/module-runner';
|
|
9
|
-
import '../chunks/startModuleRunner.
|
|
9
|
+
import '../chunks/startModuleRunner.W28wBIgJ.js';
|
|
10
10
|
import '@vitest/utils/helpers';
|
|
11
11
|
import '../path.js';
|
|
12
12
|
import 'node:path';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { w as workerInit } from '../chunks/init-threads.
|
|
2
|
-
import { r as runVmTests } from '../chunks/vm.
|
|
1
|
+
import { w as workerInit } from '../chunks/init-threads.BuMdIy1r.js';
|
|
2
|
+
import { r as runVmTests } from '../chunks/vm.Y19jrZy2.js';
|
|
3
3
|
import 'node:worker_threads';
|
|
4
|
-
import '../chunks/init.
|
|
4
|
+
import '../chunks/init.MkYs5nmh.js';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import 'vite/module-runner';
|
|
10
|
-
import '../chunks/startModuleRunner.
|
|
10
|
+
import '../chunks/startModuleRunner.W28wBIgJ.js';
|
|
11
11
|
import '@vitest/utils/helpers';
|
|
12
12
|
import '../path.js';
|
|
13
13
|
import 'node:path';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.13",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
|
|
136
136
|
"happy-dom": "*",
|
|
137
137
|
"jsdom": "*",
|
|
138
|
-
"@vitest/browser-playwright": "4.0.
|
|
139
|
-
"@vitest/browser-preview": "4.0.
|
|
140
|
-
"@vitest/browser-webdriverio": "4.0.
|
|
141
|
-
"@vitest/ui": "4.0.
|
|
138
|
+
"@vitest/browser-playwright": "4.0.13",
|
|
139
|
+
"@vitest/browser-preview": "4.0.13",
|
|
140
|
+
"@vitest/browser-webdriverio": "4.0.13",
|
|
141
|
+
"@vitest/ui": "4.0.13"
|
|
142
142
|
},
|
|
143
143
|
"peerDependenciesMeta": {
|
|
144
144
|
"@edge-runtime/vm": {
|
|
@@ -186,13 +186,13 @@
|
|
|
186
186
|
"tinyrainbow": "^3.0.3",
|
|
187
187
|
"vite": "^6.0.0 || ^7.0.0",
|
|
188
188
|
"why-is-node-running": "^2.3.0",
|
|
189
|
-
"@vitest/
|
|
190
|
-
"@vitest/
|
|
191
|
-
"@vitest/
|
|
192
|
-
"@vitest/
|
|
193
|
-
"@vitest/
|
|
194
|
-
"@vitest/
|
|
195
|
-
"@vitest/
|
|
189
|
+
"@vitest/mocker": "4.0.13",
|
|
190
|
+
"@vitest/pretty-format": "4.0.13",
|
|
191
|
+
"@vitest/runner": "4.0.13",
|
|
192
|
+
"@vitest/spy": "4.0.13",
|
|
193
|
+
"@vitest/utils": "4.0.13",
|
|
194
|
+
"@vitest/snapshot": "4.0.13",
|
|
195
|
+
"@vitest/expect": "4.0.13"
|
|
196
196
|
},
|
|
197
197
|
"devDependencies": {
|
|
198
198
|
"@antfu/install-pkg": "^1.1.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { MockedModuleType } from '@vitest/mocker';
|
|
2
|
-
|
|
3
|
-
type Promisable<T> = T | Promise<T>;
|
|
4
|
-
type MockFactoryWithHelper<M = unknown> = (importOriginal: <T extends M = M>() => Promise<T>) => Promisable<Partial<M>>;
|
|
5
|
-
type MockFactory = () => any;
|
|
6
|
-
interface MockOptions {
|
|
7
|
-
spy?: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface PendingSuiteMock {
|
|
10
|
-
id: string;
|
|
11
|
-
importer: string;
|
|
12
|
-
action: "mock" | "unmock";
|
|
13
|
-
type?: MockedModuleType;
|
|
14
|
-
factory?: MockFactory;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type { MockFactoryWithHelper as M, PendingSuiteMock as P, MockOptions as a, MockFactory as b };
|