vitest 2.2.0-beta.1 → 3.0.0-beta.1
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 +8 -8
- package/dist/browser.js +1 -1
- package/dist/chunks/{RandomSequencer.CMRlh2v4.js → RandomSequencer.gisBJ77r.js} +11 -3
- package/dist/chunks/{base.BS0HhLXd.js → base.CkcgFVQd.js} +8 -3
- package/dist/chunks/{benchmark.geERunq4.d.ts → benchmark.CFFwLv-O.d.ts} +2 -2
- package/dist/chunks/{cac.Z91LBqmg.js → cac.CWCZimpS.js} +7 -7
- package/dist/chunks/{cli-api.DVJJMJHj.js → cli-api.BKUOv0Nc.js} +928 -661
- package/dist/chunks/{config.CPguQ7J1.d.ts → config.BTPBhmK5.d.ts} +1 -1
- package/dist/chunks/{creator.IIqd8RWT.js → creator.DcAcUhMD.js} +1 -4
- package/dist/chunks/{globals.BCGEw6ON.js → globals.DJTzb7B3.js} +2 -2
- package/dist/chunks/{index.DD5eTY2y.js → index.BqHViJW9.js} +1 -1
- package/dist/chunks/{index.BjjsHdBb.js → index.CkOJwybT.js} +1 -1
- package/dist/chunks/{index.DLRzErGF.js → index.DKe7vK-G.js} +708 -548
- package/dist/chunks/{index.CqYx2Nsr.js → index.DQboAxJm.js} +23 -14
- package/dist/chunks/{inspector.70d6emsh.js → inspector.DKLceBVD.js} +1 -1
- package/dist/chunks/{reporters.B_9uUTGW.d.ts → reporters.BZbwTvrM.d.ts} +1252 -1234
- package/dist/chunks/{resolveConfig.CQIc6fe7.js → resolveConfig.3rGGWga5.js} +88 -56
- package/dist/chunks/{runBaseTests.B7hcVT-s.js → runBaseTests.C6huCAng.js} +6 -6
- package/dist/chunks/{setup-common.BfGt8K-K.js → setup-common.B5ClyS48.js} +1 -1
- package/dist/chunks/{suite.B2jumIFP.d.ts → suite.BJU7kdY9.d.ts} +4 -4
- package/dist/chunks/{utils.DNoFbBUZ.js → utils.CMUTX-p8.js} +20 -23
- package/dist/chunks/{vi.BlPttogV.js → vi.CZKezqeD.js} +18 -13
- package/dist/chunks/{vite.Bvms8Xir.d.ts → vite.DIfmneq0.d.ts} +1 -1
- package/dist/chunks/{vm.Zr4qWzDJ.js → vm.DGhTouO3.js} +10 -1
- package/dist/chunks/{worker.9VY11NZs.d.ts → worker.CmzGeuVD.d.ts} +3 -3
- package/dist/chunks/{worker.Qz1UB4Fv.d.ts → worker.umPNbBNk.d.ts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -10
- package/dist/config.d.ts +11 -11
- package/dist/config.js +1 -10
- package/dist/coverage.d.ts +7 -7
- package/dist/coverage.js +4 -4
- package/dist/execute.d.ts +3 -3
- package/dist/index.d.ts +26 -17
- package/dist/index.js +2 -2
- package/dist/node.d.ts +16 -20
- package/dist/node.js +7 -7
- package/dist/reporters.d.ts +7 -7
- package/dist/reporters.js +3 -3
- package/dist/runners.d.ts +3 -4
- package/dist/runners.js +9 -14
- package/dist/suite.d.ts +2 -2
- package/dist/worker.js +1 -1
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +6 -6
- package/dist/workers/threads.js +1 -1
- package/dist/workers/vmForks.js +1 -1
- package/dist/workers/vmThreads.js +1 -1
- package/dist/workers.d.ts +3 -3
- package/dist/workers.js +3 -3
- package/package.json +22 -22
package/dist/cli.js
CHANGED
package/dist/config.cjs
CHANGED
|
@@ -81,16 +81,7 @@ const coverageConfigDefaults = {
|
|
|
81
81
|
};
|
|
82
82
|
const fakeTimersDefaults = {
|
|
83
83
|
loopLimit: 1e4,
|
|
84
|
-
shouldClearNativeTimers: true
|
|
85
|
-
toFake: [
|
|
86
|
-
"setTimeout",
|
|
87
|
-
"clearTimeout",
|
|
88
|
-
"setInterval",
|
|
89
|
-
"clearInterval",
|
|
90
|
-
"setImmediate",
|
|
91
|
-
"clearImmediate",
|
|
92
|
-
"Date"
|
|
93
|
-
]
|
|
84
|
+
shouldClearNativeTimers: true
|
|
94
85
|
};
|
|
95
86
|
const config = {
|
|
96
87
|
allowOnly: !stdEnv.isCI,
|
package/dist/config.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport,
|
|
4
|
-
|
|
3
|
+
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.BZbwTvrM.js';
|
|
4
|
+
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.BZbwTvrM.js';
|
|
5
|
+
import './chunks/vite.DIfmneq0.js';
|
|
5
6
|
import '@vitest/runner';
|
|
6
7
|
import './chunks/environment.CT0jpO-1.js';
|
|
7
8
|
import 'node:stream';
|
|
8
9
|
import '@vitest/utils';
|
|
9
|
-
import '
|
|
10
|
+
import 'vite-node';
|
|
11
|
+
import '@vitest/utils/source-map';
|
|
12
|
+
import './chunks/config.BTPBhmK5.js';
|
|
10
13
|
import '@vitest/pretty-format';
|
|
11
14
|
import '@vitest/snapshot';
|
|
12
15
|
import '@vitest/snapshot/environment';
|
|
13
16
|
import '@vitest/utils/diff';
|
|
14
|
-
import 'vite-node';
|
|
15
17
|
import 'chai';
|
|
16
|
-
import '
|
|
17
|
-
import 'vite-node/client';
|
|
18
|
-
import 'vite-node/server';
|
|
19
|
-
import './chunks/benchmark.geERunq4.js';
|
|
18
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
20
19
|
import '@vitest/runner/utils';
|
|
21
20
|
import 'tinybench';
|
|
21
|
+
import 'vite-node/client';
|
|
22
|
+
import 'vite-node/server';
|
|
22
23
|
import '@vitest/snapshot/manager';
|
|
23
24
|
import 'node:fs';
|
|
24
25
|
|
|
@@ -59,7 +60,6 @@ declare const configDefaults: Readonly<{
|
|
|
59
60
|
fakeTimers: {
|
|
60
61
|
loopLimit: number;
|
|
61
62
|
shouldClearNativeTimers: true;
|
|
62
|
-
toFake: ("setTimeout" | "setInterval" | "clearInterval" | "clearTimeout" | "setImmediate" | "clearImmediate" | "Date")[];
|
|
63
63
|
};
|
|
64
64
|
maxConcurrency: number;
|
|
65
65
|
dangerouslyIgnoreUnhandledErrors: false;
|
|
@@ -89,6 +89,6 @@ declare function defineProject(config: UserWorkspaceConfig): UserWorkspaceConfig
|
|
|
89
89
|
declare function defineProject(config: Promise<UserWorkspaceConfig>): Promise<UserWorkspaceConfig>;
|
|
90
90
|
declare function defineProject(config: UserProjectConfigFn): UserProjectConfigFn;
|
|
91
91
|
declare function defineProject(config: UserProjectConfigExport): UserProjectConfigExport;
|
|
92
|
-
declare function defineWorkspace(config:
|
|
92
|
+
declare function defineWorkspace(config: TestProjectConfiguration[]): TestProjectConfiguration[];
|
|
93
93
|
|
|
94
|
-
export { type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig,
|
|
94
|
+
export { TestProjectConfiguration, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, defineWorkspace, extraInlineDeps };
|
package/dist/config.js
CHANGED
|
@@ -79,16 +79,7 @@ const coverageConfigDefaults = {
|
|
|
79
79
|
};
|
|
80
80
|
const fakeTimersDefaults = {
|
|
81
81
|
loopLimit: 1e4,
|
|
82
|
-
shouldClearNativeTimers: true
|
|
83
|
-
toFake: [
|
|
84
|
-
"setTimeout",
|
|
85
|
-
"clearTimeout",
|
|
86
|
-
"setInterval",
|
|
87
|
-
"clearInterval",
|
|
88
|
-
"setImmediate",
|
|
89
|
-
"clearImmediate",
|
|
90
|
-
"Date"
|
|
91
|
-
]
|
|
82
|
+
shouldClearNativeTimers: true
|
|
92
83
|
};
|
|
93
84
|
const config = {
|
|
94
85
|
allowOnly: !isCI,
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.
|
|
2
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.BZbwTvrM.js';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.CT0jpO-1.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import '
|
|
7
|
+
import 'vite-node';
|
|
8
|
+
import '@vitest/utils/source-map';
|
|
9
|
+
import './chunks/config.BTPBhmK5.js';
|
|
8
10
|
import '@vitest/pretty-format';
|
|
9
11
|
import '@vitest/snapshot';
|
|
10
12
|
import '@vitest/snapshot/environment';
|
|
11
13
|
import '@vitest/utils/diff';
|
|
12
|
-
import 'vite-node';
|
|
13
14
|
import 'chai';
|
|
14
|
-
import '
|
|
15
|
-
import 'vite-node/client';
|
|
16
|
-
import 'vite-node/server';
|
|
17
|
-
import './chunks/benchmark.geERunq4.js';
|
|
15
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
18
16
|
import '@vitest/runner/utils';
|
|
19
17
|
import 'tinybench';
|
|
18
|
+
import 'vite-node/client';
|
|
19
|
+
import 'vite-node/server';
|
|
20
20
|
import '@vitest/snapshot/manager';
|
|
21
21
|
import 'node:fs';
|
|
22
22
|
|
package/dist/coverage.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { existsSync, promises, readdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.
|
|
2
|
+
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.3rGGWga5.js';
|
|
3
3
|
import { resolve, relative } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import '@vitest/utils';
|
|
6
|
-
import 'node:path';
|
|
7
6
|
import 'node:fs/promises';
|
|
8
|
-
import 'node:process';
|
|
9
7
|
import 'node:module';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:process';
|
|
10
10
|
import 'node:url';
|
|
11
11
|
import 'node:assert';
|
|
12
12
|
import 'node:v8';
|
|
13
13
|
import 'node:util';
|
|
14
14
|
import './chunks/constants.fzPh7AOq.js';
|
|
15
15
|
import 'node:os';
|
|
16
|
-
import './chunks/RandomSequencer.
|
|
16
|
+
import './chunks/RandomSequencer.gisBJ77r.js';
|
|
17
17
|
import 'std-env';
|
|
18
18
|
import 'node:perf_hooks';
|
|
19
19
|
import '@vitest/runner/utils';
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
|
-
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.
|
|
3
|
+
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.CmzGeuVD.js';
|
|
4
4
|
import vm from 'node:vm';
|
|
5
5
|
import * as _vitest_mocker from '@vitest/mocker';
|
|
6
6
|
import { MockedModuleType } from '@vitest/mocker';
|
|
7
7
|
import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.cRtM890J.js';
|
|
8
8
|
import '@vitest/runner';
|
|
9
|
-
import './chunks/config.
|
|
9
|
+
import './chunks/config.BTPBhmK5.js';
|
|
10
10
|
import '@vitest/pretty-format';
|
|
11
11
|
import '@vitest/snapshot';
|
|
12
12
|
import '@vitest/snapshot/environment';
|
|
@@ -18,7 +18,7 @@ declare class FileMap {
|
|
|
18
18
|
private fsBufferCache;
|
|
19
19
|
readFileAsync(path: string): Promise<string>;
|
|
20
20
|
readFile(path: string): string;
|
|
21
|
-
readBuffer(path: string): Buffer
|
|
21
|
+
readBuffer(path: string): Buffer<ArrayBufferLike>;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
interface ModuleEvaluateOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { TaskResultPack as TaskResultPack$1, File as File$1, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
import { g as VitestEnvironment$1, S as SerializedTestSpecification, h as RawErrsMap$1,
|
|
4
|
-
import { W as WorkerContext$1 } from './chunks/worker.
|
|
3
|
+
import { g as VitestEnvironment$1, S as SerializedTestSpecification, h as RawErrsMap$1, i as TscErrorInfo$1, j as CollectLineNumbers$1, k as CollectLines$1, l as RootAndTarget$1, m as Context$1, b as CoverageProvider$1, a as ReportContext$1, c as CoverageProviderModule$1, n as CoverageReporter$1, o as CoverageProviderName, p as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, q as CoverageIstanbulOptions$1, d as CoverageV8Options$1, r as CustomProviderOptions$1, s as Reporter$1, V as Vitest$1, t as BrowserScript$1, u as BrowserConfigOptions$1, v as BuiltinEnvironment$1, P as Pool$1, w as PoolOptions$1, x as CSSModuleScopeStrategy$1, A as ApiConfig$1, y as VitestRunMode$1, D as DepsOptimizationOptions$1, z as TransformModePatterns$1, I as InlineConfig$1, E as TypecheckConfig$1, F as UserConfig$1, G as ResolvedConfig$1, H as ProjectConfig$1, U as UserWorkspaceConfig$1, J as BenchmarkUserOptions$1 } from './chunks/reporters.BZbwTvrM.js';
|
|
4
|
+
import { W as WorkerContext$1 } from './chunks/worker.umPNbBNk.js';
|
|
5
5
|
import { U as UserConsoleLog, M as ModuleGraphData, b as Awaitable$1, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, O as OnServerRestartHandler$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.CT0jpO-1.js';
|
|
6
6
|
export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.CT0jpO-1.js';
|
|
7
|
-
import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.
|
|
8
|
-
export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.
|
|
9
|
-
import './chunks/vite.
|
|
7
|
+
import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.CmzGeuVD.js';
|
|
8
|
+
export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.CmzGeuVD.js';
|
|
9
|
+
import './chunks/vite.DIfmneq0.js';
|
|
10
10
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
11
11
|
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
12
12
|
import { Plugin } from '@vitest/pretty-format';
|
|
13
13
|
import { SnapshotState } from '@vitest/snapshot';
|
|
14
14
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
15
|
-
import { B as BenchmarkResult } from './chunks/benchmark.
|
|
16
|
-
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.
|
|
17
|
-
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.
|
|
18
|
-
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.
|
|
15
|
+
import { B as BenchmarkResult } from './chunks/benchmark.CFFwLv-O.js';
|
|
16
|
+
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI } from './chunks/benchmark.CFFwLv-O.js';
|
|
17
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.BTPBhmK5.js';
|
|
18
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.BTPBhmK5.js';
|
|
19
19
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
20
20
|
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
21
21
|
import { M as MockFactoryWithHelper, a as MockOptions } from './chunks/mocker.cRtM890J.js';
|
|
22
|
-
export { b as bench } from './chunks/suite.
|
|
22
|
+
export { b as bench } from './chunks/suite.BJU7kdY9.js';
|
|
23
23
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
24
24
|
export { ErrorWithDiff, ParsedStack, SerializedError, TestError } from '@vitest/utils';
|
|
25
25
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
@@ -170,7 +170,8 @@ interface WebSocketHandlers {
|
|
|
170
170
|
getTransformResult: (projectName: string, id: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;
|
|
171
171
|
readTestFile: (id: string) => Promise<string | null>;
|
|
172
172
|
saveTestFile: (id: string, content: string) => Promise<void>;
|
|
173
|
-
rerun: (files: string[]) => Promise<void>;
|
|
173
|
+
rerun: (files: string[], resetTestNamePattern?: boolean) => Promise<void>;
|
|
174
|
+
rerunTask: (id: string) => Promise<void>;
|
|
174
175
|
updateSnapshot: (file?: File$1) => Promise<void>;
|
|
175
176
|
getUnhandledErrors: () => unknown[];
|
|
176
177
|
}
|
|
@@ -503,19 +504,27 @@ interface VitestUtils {
|
|
|
503
504
|
*/
|
|
504
505
|
isMockFunction: (fn: any) => fn is MockInstance;
|
|
505
506
|
/**
|
|
506
|
-
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function.
|
|
507
|
+
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function.
|
|
507
508
|
*
|
|
508
|
-
*
|
|
509
|
+
* This will only empty `.mock` state, it will not affect mock implementations.
|
|
510
|
+
*
|
|
511
|
+
* This is useful if you need to clean up mocks between different assertions within a test.
|
|
509
512
|
*/
|
|
510
513
|
clearAllMocks: () => VitestUtils;
|
|
511
514
|
/**
|
|
512
|
-
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function.
|
|
515
|
+
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function.
|
|
516
|
+
*
|
|
517
|
+
* This will empty `.mock` state, reset "once" implementations, and reset each mock's base implementation to its original.
|
|
513
518
|
*
|
|
514
|
-
* This is useful when you want to
|
|
519
|
+
* This is useful when you want to reset all mocks to their original states.
|
|
515
520
|
*/
|
|
516
521
|
resetAllMocks: () => VitestUtils;
|
|
517
522
|
/**
|
|
518
|
-
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function.
|
|
523
|
+
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function.
|
|
524
|
+
*
|
|
525
|
+
* This will empty `.mock` state, restore all original mock implementations, and restore original descriptors of spied-on objects.
|
|
526
|
+
*
|
|
527
|
+
* This is useful for inter-test cleanup and/or removing mocks created by [`vi.spyOn(...)`](https://vitest.dev/api/vi#vi-spyon).
|
|
519
528
|
*/
|
|
520
529
|
restoreAllMocks: () => VitestUtils;
|
|
521
530
|
/**
|
|
@@ -590,7 +599,7 @@ type Suite = Suite$1;
|
|
|
590
599
|
type File = File$1;
|
|
591
600
|
/** @deprecated use `RunnerTestCase` instead */
|
|
592
601
|
type Test = Test$1;
|
|
593
|
-
/** @deprecated use `
|
|
602
|
+
/** @deprecated do not use `Custom`, use `RunnerTestCase` instead */
|
|
594
603
|
type Custom = Custom$1;
|
|
595
604
|
/** @deprecated use `RunnerTask` instead */
|
|
596
605
|
type Task = Task$1;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.
|
|
1
|
+
export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.CZKezqeD.js';
|
|
2
2
|
export { i as isFirstRun, a as runOnce } from './chunks/run-once.2ogXb3JV.js';
|
|
3
|
-
export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.
|
|
3
|
+
export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.BqHViJW9.js';
|
|
4
4
|
export { b as bench } from './chunks/benchmark.Cdu9hjj4.js';
|
|
5
5
|
export { expectTypeOf } from 'expect-type';
|
|
6
6
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { B as BaseCoverageOptions,
|
|
1
|
+
import { y as VitestRunMode, K as VitestOptions, V as Vitest, F as UserConfig$1, A as ApiConfig, L as Logger, G as ResolvedConfig$1, M as TestProject, N as TestSequencer, O as WorkspaceSpec, Q as TestModule, X as ModuleDiagnostic } from './chunks/reporters.BZbwTvrM.js';
|
|
2
|
+
export { B as BaseCoverageOptions, J as BenchmarkUserOptions, ae as BrowserBuiltinProvider, af as BrowserCommand, ag as BrowserCommandContext, u as BrowserConfigOptions, ah as BrowserOrchestrator, ai as BrowserProvider, aj as BrowserProviderInitializationOptions, ak as BrowserProviderModule, al as BrowserProviderOptions, t as BrowserScript, am as BrowserServer, an as BrowserServerState, ao as BrowserServerStateContext, v as BuiltinEnvironment, ap as CDPSession, x as CSSModuleScopeStrategy, q as CoverageIstanbulOptions, p as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, n as CoverageReporter, d as CoverageV8Options, r as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, P as Pool, w as PoolOptions, Z as ProcessPool, H as ProjectConfig, a as ReportContext, as as ResolveSnapshotPathHandler, at as ResolveSnapshotPathHandlerContext, aq as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ar as ResolvedProjectConfig, $ as SerializedTestProject, a5 as TaskOptions, a3 as TestCase, a6 as TestCollection, a7 as TestDiagnostic, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, ac as TestSequencerConstructor, ad as TestSpecification, a4 as TestSuite, z as TransformModePatterns, j as TypeCheckCollectLineNumbers, k as TypeCheckCollectLines, m as TypeCheckContext, i as TypeCheckErrorInfo, h as TypeCheckRawErrorsMap, l as TypeCheckRootAndTarget, E as TypecheckConfig, U as UserWorkspaceConfig, g as VitestEnvironment, Y as VitestPackageInstaller, _ as getFilePoolName } from './chunks/reporters.BZbwTvrM.js';
|
|
3
3
|
import { UserConfig, ResolvedConfig, Plugin, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
6
6
|
export { isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
|
-
import {
|
|
8
|
-
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions, O as OnServerRestartHandler } from './chunks/environment.CT0jpO-1.js';
|
|
9
|
-
import { R as RuntimeRPC } from './chunks/worker.9VY11NZs.js';
|
|
7
|
+
import { R as RuntimeRPC } from './chunks/worker.CmzGeuVD.js';
|
|
10
8
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { W as WorkerContext } from './chunks/worker.
|
|
9
|
+
export { W as WorkerContext } from './chunks/worker.umPNbBNk.js';
|
|
10
|
+
export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions, O as OnServerRestartHandler, h as OnTestsRerunHandler } from './chunks/environment.CT0jpO-1.js';
|
|
12
11
|
import createDebug from 'debug';
|
|
13
|
-
export { b as RuntimeConfig } from './chunks/config.
|
|
12
|
+
export { b as RuntimeConfig } from './chunks/config.BTPBhmK5.js';
|
|
14
13
|
export { SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
15
14
|
import '@vitest/utils';
|
|
15
|
+
import 'vite-node';
|
|
16
|
+
import '@vitest/utils/source-map';
|
|
16
17
|
import '@vitest/pretty-format';
|
|
17
18
|
import '@vitest/snapshot';
|
|
18
19
|
import '@vitest/utils/diff';
|
|
19
|
-
import 'vite-node';
|
|
20
20
|
import 'chai';
|
|
21
|
-
import '
|
|
22
|
-
import 'vite-node/client';
|
|
23
|
-
import 'vite-node/server';
|
|
24
|
-
import './chunks/benchmark.geERunq4.js';
|
|
21
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
25
22
|
import '@vitest/runner/utils';
|
|
26
23
|
import 'tinybench';
|
|
24
|
+
import 'vite-node/client';
|
|
25
|
+
import 'vite-node/server';
|
|
27
26
|
import '@vitest/snapshot/manager';
|
|
28
27
|
import 'node:fs';
|
|
29
28
|
import 'node:worker_threads';
|
|
@@ -52,7 +51,7 @@ interface CliOptions extends UserConfig$1 {
|
|
|
52
51
|
*
|
|
53
52
|
* Returns a Vitest instance if initialized successfully.
|
|
54
53
|
*/
|
|
55
|
-
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest
|
|
54
|
+
declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
56
55
|
|
|
57
56
|
interface CLIOptions {
|
|
58
57
|
allowUnknownOptions?: boolean;
|
|
@@ -76,11 +75,8 @@ declare class GitNotFoundError extends Error {
|
|
|
76
75
|
constructor();
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
provide: <T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]) => void;
|
|
82
|
-
onTestsRerun: (cb: OnTestsRerunHandler) => void;
|
|
83
|
-
}
|
|
78
|
+
/** @deprecated use `TestProject` instead */
|
|
79
|
+
type GlobalSetupContext = TestProject;
|
|
84
80
|
|
|
85
81
|
declare function VitestPlugin(options?: UserConfig$1, ctx?: Vitest): Promise<Plugin[]>;
|
|
86
82
|
|
|
@@ -89,7 +85,7 @@ declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | fa
|
|
|
89
85
|
interface MethodsOptions {
|
|
90
86
|
cacheFs?: boolean;
|
|
91
87
|
}
|
|
92
|
-
declare function createMethodsRPC(project:
|
|
88
|
+
declare function createMethodsRPC(project: TestProject, options?: MethodsOptions): RuntimeRPC;
|
|
93
89
|
|
|
94
90
|
declare class BaseSequencer implements TestSequencer {
|
|
95
91
|
protected ctx: Vitest;
|
|
@@ -121,4 +117,4 @@ declare const TestFile: typeof TestModule;
|
|
|
121
117
|
*/
|
|
122
118
|
type FileDiagnostic = ModuleDiagnostic;
|
|
123
119
|
|
|
124
|
-
export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic,
|
|
120
|
+
export { ApiConfig, BaseSequencer, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig$1 as ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, FilesNotFoundError as TestsNotFoundError, UserConfig$1 as UserConfig, Vitest, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
package/dist/node.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createServer as createServer$1 } from 'vite';
|
|
2
2
|
export { isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
3
|
-
import { f as TestModule } from './chunks/index.
|
|
4
|
-
export { e as TestCase,
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
export { G as GitNotFoundError, T as TestSpecification, F as TestsNotFoundError, V as VitestPackageInstaller, a as VitestPlugin, d as createViteLogger, c as createVitest, b as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
7
|
-
export { d as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig, b as resolveConfig } from './chunks/resolveConfig.
|
|
8
|
-
export { B as BaseSequencer } from './chunks/RandomSequencer.
|
|
3
|
+
import { f as TestModule } from './chunks/index.DKe7vK-G.js';
|
|
4
|
+
export { e as TestCase, g as TestSuite } from './chunks/index.DKe7vK-G.js';
|
|
5
|
+
export { p as parseCLI } from './chunks/cac.CWCZimpS.js';
|
|
6
|
+
export { G as GitNotFoundError, T as TestSpecification, F as TestsNotFoundError, V as VitestPackageInstaller, a as VitestPlugin, d as createViteLogger, c as createVitest, b as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.BKUOv0Nc.js';
|
|
7
|
+
export { d as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig, b as resolveConfig } from './chunks/resolveConfig.3rGGWga5.js';
|
|
8
|
+
export { B as BaseSequencer } from './chunks/RandomSequencer.gisBJ77r.js';
|
|
9
9
|
export { distDir, rootDir } from './path.js';
|
|
10
10
|
import createDebug from 'debug';
|
|
11
11
|
import 'node:fs';
|
|
12
12
|
import '@vitest/runner/utils';
|
|
13
13
|
import 'pathe';
|
|
14
14
|
import 'tinyrainbow';
|
|
15
|
-
import './chunks/utils.
|
|
15
|
+
import './chunks/utils.CMUTX-p8.js';
|
|
16
16
|
import 'node:util';
|
|
17
17
|
import '@vitest/utils';
|
|
18
18
|
import 'node:perf_hooks';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { aE as BaseReporter, au as BasicReporter, aO as BenchmarkBuiltinReporters, aN as BenchmarkReportsMap, aJ as BuiltinReporterOptions, aI as BuiltinReporters, av as DefaultReporter, aw as DotReporter, aG as FileDiagnostic, ax as GithubActionsReporter, ay as HangingProcessReporter, aA as JUnitReporter, aK as JsonAssertionResult, az as JsonReporter, aL as JsonTestResult, aM as JsonTestResults,
|
|
1
|
+
export { aE as BaseReporter, au as BasicReporter, aO as BenchmarkBuiltinReporters, aN as BenchmarkReportsMap, aJ as BuiltinReporterOptions, aI as BuiltinReporters, av as DefaultReporter, aw as DotReporter, aG as FileDiagnostic, ax as GithubActionsReporter, ay as HangingProcessReporter, aA as JUnitReporter, aK as JsonAssertionResult, az as JsonReporter, aL as JsonTestResult, aM as JsonTestResults, s as Reporter, aH as ReportersMap, aB as TapFlatReporter, aC as TapReporter, a5 as TaskOptions, a3 as TestCase, a6 as TestCollection, a7 as TestDiagnostic, aF as TestFile, Q as TestModule, M as TestProject, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, a4 as TestSuite, aD as VerboseReporter } from './chunks/reporters.BZbwTvrM.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.CT0jpO-1.js';
|
|
4
4
|
import 'node:stream';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import '
|
|
7
|
+
import 'vite-node';
|
|
8
|
+
import '@vitest/utils/source-map';
|
|
9
|
+
import './chunks/config.BTPBhmK5.js';
|
|
8
10
|
import '@vitest/pretty-format';
|
|
9
11
|
import '@vitest/snapshot';
|
|
10
12
|
import '@vitest/snapshot/environment';
|
|
11
13
|
import '@vitest/utils/diff';
|
|
12
|
-
import 'vite-node';
|
|
13
14
|
import 'chai';
|
|
14
|
-
import '
|
|
15
|
-
import 'vite-node/client';
|
|
16
|
-
import 'vite-node/server';
|
|
17
|
-
import './chunks/benchmark.geERunq4.js';
|
|
15
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
18
16
|
import '@vitest/runner/utils';
|
|
19
17
|
import 'tinybench';
|
|
18
|
+
import 'vite-node/client';
|
|
19
|
+
import 'vite-node/server';
|
|
20
20
|
import '@vitest/snapshot/manager';
|
|
21
21
|
import 'node:fs';
|
package/dist/reporters.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { B as BasicReporter, h as BenchmarkReportsMap, 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, e as TestCase, d as TestFile, f as TestModule, g as TestSuite, V as VerboseReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, h as BenchmarkReportsMap, 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, e as TestCase, d as TestFile, f as TestModule, g as TestSuite, V as VerboseReporter } from './chunks/index.DKe7vK-G.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import '@vitest/runner/utils';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
|
-
import './chunks/utils.
|
|
6
|
+
import './chunks/utils.CMUTX-p8.js';
|
|
7
7
|
import 'node:util';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'node:perf_hooks';
|
|
10
10
|
import '@vitest/utils/source-map';
|
|
11
|
-
import './chunks/RandomSequencer.
|
|
11
|
+
import './chunks/RandomSequencer.gisBJ77r.js';
|
|
12
12
|
import 'std-env';
|
|
13
13
|
import 'node:fs/promises';
|
|
14
14
|
import 'tinyexec';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
|
-
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test,
|
|
3
|
-
import { S as SerializedConfig } from './chunks/config.
|
|
2
|
+
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TaskContext, ExtendedContext } from '@vitest/runner';
|
|
3
|
+
import { S as SerializedConfig } from './chunks/config.BTPBhmK5.js';
|
|
4
4
|
import '@vitest/pretty-format';
|
|
5
5
|
import '@vitest/snapshot';
|
|
6
6
|
import '@vitest/snapshot/environment';
|
|
@@ -27,7 +27,6 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
27
27
|
constructor(config: SerializedConfig);
|
|
28
28
|
importFile(filepath: string, source: VitestRunnerImportSource): unknown;
|
|
29
29
|
onCollectStart(file: File): void;
|
|
30
|
-
onBeforeRunFiles(): void;
|
|
31
30
|
onAfterRunFiles(): void;
|
|
32
31
|
onAfterRunSuite(suite: Suite): Promise<void>;
|
|
33
32
|
onAfterRunTask(test: Task): void;
|
|
@@ -37,7 +36,7 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
37
36
|
onBeforeRunSuite(suite: Suite): Promise<void>;
|
|
38
37
|
onBeforeTryTask(test: Task): void;
|
|
39
38
|
onAfterTryTask(test: Task): void;
|
|
40
|
-
extendTaskContext<T extends Test
|
|
39
|
+
extendTaskContext<T extends Test>(context: TaskContext<T>): ExtendedContext<T>;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export { NodeBenchmarkRunner, VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -4,7 +4,7 @@ import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.Cdu9hj
|
|
|
4
4
|
import { g as getWorkerState } from './chunks/utils.C8RiOc4B.js';
|
|
5
5
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
6
6
|
import { getTests, getNames, getTestName } from '@vitest/runner/utils';
|
|
7
|
-
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.
|
|
7
|
+
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.CZKezqeD.js';
|
|
8
8
|
import { r as rpc } from './chunks/rpc.C3q9uwRX.js';
|
|
9
9
|
import 'chai';
|
|
10
10
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -168,10 +168,8 @@ class VitestTestRunner {
|
|
|
168
168
|
onCollectStart(file) {
|
|
169
169
|
this.workerState.current = file;
|
|
170
170
|
}
|
|
171
|
-
onBeforeRunFiles() {
|
|
172
|
-
this.snapshotClient.clear();
|
|
173
|
-
}
|
|
174
171
|
onAfterRunFiles() {
|
|
172
|
+
this.snapshotClient.clear();
|
|
175
173
|
this.workerState.current = void 0;
|
|
176
174
|
}
|
|
177
175
|
async onAfterRunSuite(suite) {
|
|
@@ -182,18 +180,15 @@ class VitestTestRunner {
|
|
|
182
180
|
for (const test of getTests(suite)) {
|
|
183
181
|
if (test.mode === "skip") {
|
|
184
182
|
const name = getNames(test).slice(1).join(" > ");
|
|
185
|
-
this.snapshotClient.
|
|
183
|
+
this.snapshotClient.skipTest(suite.file.filepath, name);
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
|
-
const result = await this.snapshotClient.
|
|
189
|
-
|
|
190
|
-
await rpc().snapshotSaved(result);
|
|
191
|
-
}
|
|
186
|
+
const result = await this.snapshotClient.finish(suite.file.filepath);
|
|
187
|
+
await rpc().snapshotSaved(result);
|
|
192
188
|
}
|
|
193
189
|
this.workerState.current = suite.suite || suite.file;
|
|
194
190
|
}
|
|
195
191
|
onAfterRunTask(test) {
|
|
196
|
-
this.snapshotClient.clearTest();
|
|
197
192
|
if (this.config.logHeapUsage && typeof process !== "undefined") {
|
|
198
193
|
test.result.heap = process.memoryUsage().heapUsed;
|
|
199
194
|
}
|
|
@@ -220,15 +215,15 @@ class VitestTestRunner {
|
|
|
220
215
|
suite.mode = "skip";
|
|
221
216
|
}
|
|
222
217
|
if (suite.mode !== "skip" && "filepath" in suite) {
|
|
223
|
-
await this.snapshotClient.
|
|
224
|
-
suite.filepath,
|
|
225
|
-
"__default_name_",
|
|
218
|
+
await this.snapshotClient.setup(
|
|
219
|
+
suite.file.filepath,
|
|
226
220
|
this.workerState.config.snapshotOptions
|
|
227
221
|
);
|
|
228
222
|
}
|
|
229
223
|
this.workerState.current = suite;
|
|
230
224
|
}
|
|
231
225
|
onBeforeTryTask(test) {
|
|
226
|
+
this.snapshotClient.clearTest(test.file.filepath, test.id);
|
|
232
227
|
setState(
|
|
233
228
|
{
|
|
234
229
|
assertionCalls: 0,
|
|
@@ -238,7 +233,7 @@ class VitestTestRunner {
|
|
|
238
233
|
expectedAssertionsNumberErrorGen: null,
|
|
239
234
|
testPath: test.file.filepath,
|
|
240
235
|
currentTestName: getTestName(test),
|
|
241
|
-
snapshotState: this.snapshotClient.
|
|
236
|
+
snapshotState: this.snapshotClient.getSnapshotState(test.file.filepath)
|
|
242
237
|
},
|
|
243
238
|
globalThis[GLOBAL_EXPECT]
|
|
244
239
|
);
|
package/dist/suite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.
|
|
1
|
+
export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.BJU7kdY9.js';
|
|
2
2
|
export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
|
|
3
3
|
export { createChainable } from '@vitest/runner/utils';
|
|
4
|
-
import './chunks/benchmark.
|
|
4
|
+
import './chunks/benchmark.CFFwLv-O.js';
|
|
5
5
|
import 'tinybench';
|
package/dist/worker.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ViteNodeRunner, ModuleCacheMap } from 'vite-node/client';
|
|
|
5
5
|
import { readFileSync } from 'node:fs';
|
|
6
6
|
import { resolve, normalize } from 'pathe';
|
|
7
7
|
import { e as environments } from './chunks/index.K90BXFOx.js';
|
|
8
|
-
import { s as setupInspect } from './chunks/inspector.
|
|
8
|
+
import { s as setupInspect } from './chunks/inspector.DKLceBVD.js';
|
|
9
9
|
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.C3q9uwRX.js';
|
|
10
10
|
import { i as isChildProcess, s as setProcessTitle } from './chunks/utils.C8RiOc4B.js';
|
|
11
11
|
import { d as disposeInternalListeners } from './chunks/utils.Cn0zI1t3.js';
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.CkcgFVQd.js';
|
|
3
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
|
|
4
4
|
import 'vite-node/client';
|
|
5
5
|
import '../chunks/execute.2pr0rHgK.js';
|
|
@@ -5,11 +5,11 @@ import util from 'node:util';
|
|
|
5
5
|
import { startTests, collectTests } from '@vitest/runner';
|
|
6
6
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
7
7
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
8
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
8
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.CkOJwybT.js';
|
|
9
9
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.BoMDb1ip.js';
|
|
10
|
-
import { V as VitestIndex } from '../chunks/index.
|
|
11
|
-
import { c as closeInspector } from '../chunks/inspector.
|
|
12
|
-
import { s as setupCommonEnv } from '../chunks/setup-common.
|
|
10
|
+
import { V as VitestIndex } from '../chunks/index.BqHViJW9.js';
|
|
11
|
+
import { c as closeInspector } from '../chunks/inspector.DKLceBVD.js';
|
|
12
|
+
import { s as setupCommonEnv } from '../chunks/setup-common.B5ClyS48.js';
|
|
13
13
|
import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import 'node:path';
|
|
@@ -18,7 +18,7 @@ import 'node:url';
|
|
|
18
18
|
import '../chunks/rpc.C3q9uwRX.js';
|
|
19
19
|
import '@vitest/utils';
|
|
20
20
|
import '../chunks/index.68735LiX.js';
|
|
21
|
-
import '../chunks/vi.
|
|
21
|
+
import '../chunks/vi.CZKezqeD.js';
|
|
22
22
|
import '@vitest/expect';
|
|
23
23
|
import '@vitest/runner/utils';
|
|
24
24
|
import '../chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -74,7 +74,7 @@ async function run(method, files, config, executor) {
|
|
|
74
74
|
workerState.durations.prepare = performance.now() - workerState.durations.prepare;
|
|
75
75
|
const { vi } = VitestIndex;
|
|
76
76
|
for (const file of files) {
|
|
77
|
-
workerState.filepath = file;
|
|
77
|
+
workerState.filepath = file.filepath;
|
|
78
78
|
if (method === "run") {
|
|
79
79
|
await startTests([file], runner);
|
|
80
80
|
} else {
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.CkcgFVQd.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../chunks/execute.2pr0rHgK.js';
|