vitest 4.0.17 → 4.1.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 +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.XJJQZiKB.js → base.CBRNZa3k.js} +8 -7
- package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.8hOapKZr.d.ts} +3 -1
- package/dist/chunks/{cac.jRCLJDDc.js → cac.B1v3xxoC.js} +26 -8
- package/dist/chunks/{cli-api.Cx2DW4Bc.js → cli-api.B4CqEpI6.js} +102 -54
- package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.idH22YSr.d.ts} +8 -11
- package/dist/chunks/{console.Cf-YriPC.js → console.uGgdMhyZ.js} +2 -1
- package/dist/chunks/{coverage.AVPTjMgw.js → coverage.BMlOMIWl.js} +14 -4
- package/dist/chunks/{creator.DAmOKTvJ.js → creator.C7WwjkuR.js} +32 -1
- package/dist/chunks/{globals.DOayXfHP.js → globals.DjuGMoMc.js} +10 -9
- package/dist/chunks/{index.Z5E_ObnR.js → index.BEFi2-_3.js} +3 -1
- package/dist/chunks/{index.6Qv1eEA6.js → index.BiOAd_ki.js} +16 -4
- package/dist/chunks/{index.M8mOzt4Y.js → index.Dm4xqZ0s.js} +2 -2
- package/dist/chunks/{index.C5r1PdPD.js → index.DyBZXrH3.js} +1 -1
- package/dist/chunks/{init-forks.BC6ZwHQN.js → init-forks.CHeQ9Moq.js} +1 -1
- package/dist/chunks/{init-threads.CxSxLC0N.js → init-threads.uZiNAuPk.js} +1 -1
- package/dist/chunks/{init.C9kljSTm.js → init.DVtKdFty.js} +21 -6
- package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.D8KU2PY_.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.Db3MiIWX.d.ts} +48 -20
- package/dist/chunks/rpc.HLmECnw_.js +148 -0
- package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.BcqLPsn5.js} +1 -1
- package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startModuleRunner.C5CcWyXW.js} +22 -22
- package/dist/chunks/{vi.2VT5v0um.js → test.prxIahgM.js} +500 -119
- package/dist/chunks/{vm.CMjifoPa.js → vm.CrifS09m.js} +5 -8
- package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.Bji1eq5g.d.ts} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +9 -9
- package/dist/coverage.d.ts +7 -7
- package/dist/coverage.js +3 -1
- package/dist/environments.js +2 -0
- package/dist/index.d.ts +21 -9
- package/dist/index.js +8 -7
- package/dist/module-evaluator.js +1 -5
- package/dist/node.d.ts +11 -10
- package/dist/node.js +19 -19
- package/dist/reporters.d.ts +7 -7
- package/dist/reporters.js +4 -2
- package/dist/runners.d.ts +23 -4
- package/dist/runners.js +4 -4
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +36 -0
- package/dist/snapshot.js +2 -0
- package/dist/suite.js +2 -0
- package/dist/worker.d.ts +4 -3
- package/dist/worker.js +8 -10
- package/dist/workers/forks.js +9 -11
- package/dist/workers/runVmTests.js +10 -12
- package/dist/workers/threads.js +9 -11
- package/dist/workers/vmForks.js +6 -7
- package/dist/workers/vmThreads.js +6 -7
- package/package.json +23 -27
- 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
|
@@ -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, e as emitModuleRunner } from './init.DVtKdFty.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
|
-
import { createCustomConsole } from './console.
|
|
6
|
+
import { createCustomConsole } from './console.uGgdMhyZ.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,7 +11,7 @@ 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,
|
|
14
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta, V as VITEST_VM_CONTEXT_SYMBOL } from './startModuleRunner.C5CcWyXW.js';
|
|
15
15
|
import { p as provideWorkerState } from './utils.DvEY5TfP.js';
|
|
16
16
|
|
|
17
17
|
function interopCommonJsModule(interopDefault, mod) {
|
|
@@ -716,6 +716,7 @@ async function runVmTests(method, state, traces) {
|
|
|
716
716
|
createImportMeta: createNodeImportMeta,
|
|
717
717
|
traces
|
|
718
718
|
});
|
|
719
|
+
emitModuleRunner(moduleRunner);
|
|
719
720
|
Object.defineProperty(context, VITEST_VM_CONTEXT_SYMBOL, {
|
|
720
721
|
value: {
|
|
721
722
|
context,
|
|
@@ -733,12 +734,8 @@ async function runVmTests(method, state, traces) {
|
|
|
733
734
|
}
|
|
734
735
|
await moduleRunner.mocker.initializeSpyModule();
|
|
735
736
|
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
737
|
try {
|
|
741
|
-
await run(method,
|
|
738
|
+
await run(method, ctx.files, ctx.config, moduleRunner, traces);
|
|
742
739
|
} finally {
|
|
743
740
|
await traces.$("vitest.runtime.environment.teardown", () => vm.teardown?.());
|
|
744
741
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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.idH22YSr.js';
|
|
4
4
|
import { E as Environment } from './environment.d.CrsxCzP1.js';
|
|
5
5
|
import { R as RuntimeRPC, a as RunnerRPC } from './rpc.d.RH3apGEf.js';
|
|
6
6
|
|
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.B1v3xxoC.js';
|
|
2
2
|
import '@vitest/utils/helpers';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
6
|
import './chunks/constants.D_Q9UYh-.js';
|
|
7
|
-
import './chunks/index.
|
|
7
|
+
import './chunks/index.Dm4xqZ0s.js';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'node:perf_hooks';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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.
|
|
3
|
+
import { I as InlineConfig, C as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, b as UserProjectConfigFn, c as UserProjectConfigExport } from './chunks/reporters.d.Db3MiIWX.js';
|
|
4
|
+
export { a as TestProjectConfiguration, e as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.Db3MiIWX.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.D8KU2PY_.js';
|
|
6
|
+
import { F as FakeTimerInstallOpts } from './chunks/config.d.idH22YSr.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import './chunks/rpc.d.RH3apGEf.js';
|
|
@@ -11,12 +11,9 @@ 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.8hOapKZr.js';
|
|
15
|
+
import './chunks/worker.d.Bji1eq5g.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/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 } from './chunks/reporters.d.Db3MiIWX.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/rpc.d.RH3apGEf.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.8hOapKZr.js';
|
|
8
8
|
import './chunks/traces.d.402V_yFI.js';
|
|
9
|
-
import './chunks/worker.d.
|
|
9
|
+
import './chunks/worker.d.Bji1eq5g.js';
|
|
10
10
|
import 'vite/module-runner';
|
|
11
|
-
import './chunks/config.d.
|
|
11
|
+
import './chunks/config.d.idH22YSr.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';
|
package/dist/coverage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseCoverageProvider } from './chunks/coverage.
|
|
1
|
+
export { B as BaseCoverageProvider } from './chunks/coverage.BMlOMIWl.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
@@ -21,3 +21,5 @@ import 'node:util';
|
|
|
21
21
|
import 'vite';
|
|
22
22
|
import './chunks/constants.D_Q9UYh-.js';
|
|
23
23
|
import './chunks/coverage.D_JHT54q.js';
|
|
24
|
+
|
|
25
|
+
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,14 +1,14 @@
|
|
|
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.
|
|
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.8hOapKZr.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.8hOapKZr.js';
|
|
3
3
|
import './chunks/global.d.B15mdLcR.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, 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.
|
|
8
|
+
import { b as BirpcReturn } from './chunks/worker.d.Bji1eq5g.js';
|
|
9
|
+
export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.Bji1eq5g.js';
|
|
10
|
+
import { S as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.idH22YSr.js';
|
|
11
|
+
export { b as RuntimeConfig, a as SerializedCoverageConfig } from './chunks/config.d.idH22YSr.js';
|
|
12
12
|
import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/rpc.d.RH3apGEf.js';
|
|
13
13
|
export { A as AfterSuiteRunMeta, a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
14
14
|
import { ExpectStatic } from '@vitest/expect';
|
|
@@ -17,6 +17,7 @@ import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePar
|
|
|
17
17
|
export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
18
18
|
export { b as bench } from './chunks/suite.d.BJWk38HB.js';
|
|
19
19
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
20
|
+
export { NodeBenchmarkRunner as BenchmarkRunner, VitestTestRunner as TestRunner } from './runners.js';
|
|
20
21
|
export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';
|
|
21
22
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
22
23
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
@@ -203,6 +204,15 @@ interface VitestUtils {
|
|
|
203
204
|
*/
|
|
204
205
|
clearAllTimers: () => VitestUtils;
|
|
205
206
|
/**
|
|
207
|
+
* Controls how fake timers are advanced.
|
|
208
|
+
* @param mode The mode to use for advancing timers.
|
|
209
|
+
* - `manual`: The default behavior. Timers will only advance when you call one of `vi.advanceTimers...()` methods.
|
|
210
|
+
* - `nextTimerAsync`: Timers will be advanced automatically to the next available timer after each macrotask.
|
|
211
|
+
* - `interval`: Timers are advanced automatically by a specified interval.
|
|
212
|
+
* @param interval The interval in milliseconds to use when `mode` is `'interval'`.
|
|
213
|
+
*/
|
|
214
|
+
setTimerTickMode: ((mode: "manual" | "nextTimerAsync") => VitestUtils) & ((mode: "interval", interval?: number) => VitestUtils);
|
|
215
|
+
/**
|
|
206
216
|
* 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
217
|
* @example
|
|
208
218
|
* ```ts
|
|
@@ -314,9 +324,11 @@ interface VitestUtils {
|
|
|
314
324
|
* Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).
|
|
315
325
|
* @param path Path to the module. Can be aliased, if your Vitest config supports it
|
|
316
326
|
* @param factory Mocked module factory. The result of this function will be an exports object
|
|
327
|
+
*
|
|
328
|
+
* @returns A disposable object that calls {@link doUnmock()} when disposed
|
|
317
329
|
*/
|
|
318
|
-
doMock(path: string, factory?: MockFactoryWithHelper | MockOptions):
|
|
319
|
-
doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions):
|
|
330
|
+
doMock(path: string, factory?: MockFactoryWithHelper | MockOptions): Disposable;
|
|
331
|
+
doMock<T>(module: Promise<T>, factory?: MockFactoryWithHelper<T> | MockOptions): Disposable;
|
|
320
332
|
/**
|
|
321
333
|
* Removes module from mocked registry. All subsequent calls to import will return original module.
|
|
322
334
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export {
|
|
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.prxIahgM.js';
|
|
2
2
|
export { b as bench } from './chunks/benchmark.B3N2zMcH.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.BEFi2-_3.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.DvEY5TfP.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.HLmECnw_.js';
|
|
20
|
+
import './chunks/index.Chj8NDwU.js';
|
|
20
21
|
import 'vite/module-runner';
|
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.Db3MiIWX.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.Db3MiIWX.js';
|
|
8
|
+
export { C as CacheKeyIdGenerator, a as CacheKeyIdGeneratorContext, V as VitestPluginContext } from './chunks/plugin.d.D8KU2PY_.js';
|
|
9
|
+
export { BaseCoverageProvider } from './coverage.js';
|
|
9
10
|
import { Awaitable } from '@vitest/utils';
|
|
10
11
|
export { SerializedError } from '@vitest/utils';
|
|
11
12
|
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.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.Bji1eq5g.js';
|
|
15
|
+
export { T as TestExecutionType } from './chunks/worker.d.Bji1eq5g.js';
|
|
15
16
|
import { Debugger } from 'obug';
|
|
16
17
|
import './chunks/global.d.B15mdLcR.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.idH22YSr.js';
|
|
19
20
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
20
|
-
import './chunks/browser.d.
|
|
21
|
+
import './chunks/browser.d.8hOapKZr.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,17 +1,19 @@
|
|
|
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.B4CqEpI6.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.B4CqEpI6.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.B1v3xxoC.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.BMlOMIWl.js';
|
|
8
|
+
export { B as BaseCoverageProvider, b as BaseSequencer, a as resolveApiServerConfig } from './chunks/coverage.BMlOMIWl.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
12
|
import { c as configFiles } from './chunks/constants.D_Q9UYh-.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.Dm4xqZ0s.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.DyBZXrH3.js';
|
|
15
17
|
import 'node:fs';
|
|
16
18
|
import './chunks/coverage.D_JHT54q.js';
|
|
17
19
|
import 'node:path';
|
|
@@ -19,19 +21,6 @@ import 'node:os';
|
|
|
19
21
|
import '@vitest/snapshot/manager';
|
|
20
22
|
import 'node:perf_hooks';
|
|
21
23
|
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
24
|
import 'events';
|
|
36
25
|
import 'https';
|
|
37
26
|
import 'http';
|
|
@@ -46,10 +35,16 @@ import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
|
46
35
|
import 'node:crypto';
|
|
47
36
|
import './chunks/traces.CCmnQaNT.js';
|
|
48
37
|
import 'obug';
|
|
38
|
+
import 'node:fs/promises';
|
|
39
|
+
import 'tinyrainbow';
|
|
49
40
|
import '#module-evaluator';
|
|
50
41
|
import 'vite/module-runner';
|
|
42
|
+
import 'node:console';
|
|
51
43
|
import '@vitest/utils/highlight';
|
|
44
|
+
import 'node:module';
|
|
52
45
|
import 'node:url';
|
|
46
|
+
import './chunks/env.D4Lgay0q.js';
|
|
47
|
+
import 'std-env';
|
|
53
48
|
import 'node:tty';
|
|
54
49
|
import 'node:events';
|
|
55
50
|
import './chunks/modules.BJuCwlRJ.js';
|
|
@@ -63,13 +58,18 @@ import './chunks/defaults.BOqNVLsY.js';
|
|
|
63
58
|
import '@vitest/utils/constants';
|
|
64
59
|
import '@vitest/utils/resolver';
|
|
65
60
|
import 'es-module-lexer';
|
|
66
|
-
import './chunks/index.C5r1PdPD.js';
|
|
67
61
|
import 'node:assert';
|
|
68
62
|
import '@vitest/utils/serialize';
|
|
63
|
+
import '@vitest/utils/source-map';
|
|
69
64
|
import 'node:readline';
|
|
65
|
+
import 'node:util';
|
|
70
66
|
import 'node:process';
|
|
71
67
|
import 'node:v8';
|
|
72
68
|
import 'readline';
|
|
69
|
+
import 'node:stream';
|
|
70
|
+
import '@vitest/utils/display';
|
|
71
|
+
import 'tinyexec';
|
|
72
|
+
import '@vitest/utils/offset';
|
|
73
73
|
|
|
74
74
|
// this is only exported as a public function and not used inside vitest
|
|
75
75
|
async function resolveConfig(options = {}, viteOverrides = {}) {
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { z as BaseReporter, E as BenchmarkBuiltinReporters, B as BenchmarkReporter, r as BenchmarkReportsMap, F as BuiltinReporterOptions, K as BuiltinReporters, D as DefaultReporter, s as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, t as JUnitReporter, M as JsonAssertionResult, J as JsonReporter, N as JsonTestResult, Q as JsonTestResults, X as ReportedHookContext, Y as Reporter, u as ReportersMap, v as TapFlatReporter, w as TapReporter, Z as TestRunEndReason, x as VerboseBenchmarkReporter, y as VerboseReporter } from './chunks/reporters.d.Db3MiIWX.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils';
|
|
4
4
|
import './chunks/rpc.d.RH3apGEf.js';
|
|
@@ -7,20 +7,20 @@ import 'vite/module-runner';
|
|
|
7
7
|
import './chunks/traces.d.402V_yFI.js';
|
|
8
8
|
import 'node:stream';
|
|
9
9
|
import 'vite';
|
|
10
|
-
import './chunks/browser.d.
|
|
11
|
-
import './chunks/worker.d.
|
|
12
|
-
import './chunks/config.d.
|
|
10
|
+
import './chunks/browser.d.8hOapKZr.js';
|
|
11
|
+
import './chunks/worker.d.Bji1eq5g.js';
|
|
12
|
+
import './chunks/config.d.idH22YSr.js';
|
|
13
13
|
import '@vitest/pretty-format';
|
|
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';
|
package/dist/reporters.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.
|
|
2
|
-
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.
|
|
1
|
+
export { D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, b as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, V as VerboseReporter } from './chunks/index.Dm4xqZ0s.js';
|
|
2
|
+
export { B as BenchmarkReporter, a as BenchmarkReportsMap, V as VerboseBenchmarkReporter } from './chunks/index.DyBZXrH3.js';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'pathe';
|
|
@@ -22,3 +22,5 @@ import 'node:url';
|
|
|
22
22
|
import 'vite';
|
|
23
23
|
import '@vitest/utils/offset';
|
|
24
24
|
import 'node:module';
|
|
25
|
+
|
|
26
|
+
console.warn("Importing from \"vitest/reporters\" is deprecated since Vitest 4.1. Please use \"vitest/node\" instead.");
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as tinybench from 'tinybench';
|
|
2
|
-
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
|
|
2
|
+
import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration, createTaskCollector, getCurrentSuite, getCurrentTest, getHooks, getFn } from '@vitest/runner';
|
|
3
3
|
export { VitestRunner } from '@vitest/runner';
|
|
4
|
-
import { S as SerializedConfig } from './chunks/config.d.
|
|
4
|
+
import { S as SerializedConfig } from './chunks/config.d.idH22YSr.js';
|
|
5
5
|
import { T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
6
|
+
import { createChainable } from '@vitest/runner/utils';
|
|
7
|
+
import { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.BJWk38HB.js';
|
|
6
8
|
import '@vitest/pretty-format';
|
|
7
9
|
import '@vitest/snapshot';
|
|
8
10
|
import '@vitest/utils/diff';
|
|
11
|
+
import './chunks/benchmark.d.DAaHLpsq.js';
|
|
9
12
|
|
|
10
13
|
declare class NodeBenchmarkRunner implements VitestRunner {
|
|
11
14
|
config: SerializedConfig;
|
|
@@ -17,7 +20,7 @@ declare class NodeBenchmarkRunner implements VitestRunner {
|
|
|
17
20
|
runTask(): Promise<void>;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
declare class
|
|
23
|
+
declare class TestRunner implements VitestRunner {
|
|
21
24
|
config: SerializedConfig;
|
|
22
25
|
private snapshotClient;
|
|
23
26
|
private workerState;
|
|
@@ -45,6 +48,22 @@ declare class VitestTestRunner implements VitestRunner {
|
|
|
45
48
|
getImportDurations(): Record<string, ImportDuration>;
|
|
46
49
|
trace: <T>(name: string, attributes: Record<string, any> | (() => T), cb?: () => T) => T;
|
|
47
50
|
__setTraces(traces: Traces): void;
|
|
51
|
+
static createTaskCollector: typeof createTaskCollector;
|
|
52
|
+
static getCurrentSuite: typeof getCurrentSuite;
|
|
53
|
+
static getCurrentTest: typeof getCurrentTest;
|
|
54
|
+
static createChainable: typeof createChainable;
|
|
55
|
+
static getSuiteHooks: typeof getHooks;
|
|
56
|
+
static getTestFn: typeof getFn;
|
|
57
|
+
static setSuiteHooks: typeof getHooks;
|
|
58
|
+
static setTestFn: typeof getFn;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*/
|
|
62
|
+
static getBenchFn: typeof getBenchFn;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
static getBenchOptions: typeof getBenchOptions;
|
|
48
67
|
}
|
|
49
68
|
|
|
50
|
-
export { NodeBenchmarkRunner, VitestTestRunner };
|
|
69
|
+
export { NodeBenchmarkRunner, TestRunner as VitestTestRunner };
|
package/dist/runners.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { N as NodeBenchmarkRunner,
|
|
1
|
+
export { N as NodeBenchmarkRunner, T as VitestTestRunner } from './chunks/test.prxIahgM.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import '@vitest/utils/helpers';
|
|
4
4
|
import '@vitest/utils/timers';
|
|
@@ -8,12 +8,12 @@ import './chunks/utils.DvEY5TfP.js';
|
|
|
8
8
|
import '@vitest/expect';
|
|
9
9
|
import '@vitest/utils/error';
|
|
10
10
|
import 'pathe';
|
|
11
|
-
import './chunks/vi.2VT5v0um.js';
|
|
12
11
|
import '@vitest/snapshot';
|
|
13
12
|
import '@vitest/spy';
|
|
14
13
|
import '@vitest/utils/offset';
|
|
15
14
|
import '@vitest/utils/source-map';
|
|
16
15
|
import './chunks/_commonjsHelpers.D26ty3Ew.js';
|
|
17
|
-
import './chunks/
|
|
18
|
-
import './chunks/rpc.BoxB0q7B.js';
|
|
16
|
+
import './chunks/rpc.HLmECnw_.js';
|
|
19
17
|
import './chunks/index.Chj8NDwU.js';
|
|
18
|
+
|
|
19
|
+
console.warn("Importing from \"vitest/runners\" is deprecated since Vitest 4.1. Please use \"vitest\" instead.");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { builtinEnvironments, populateGlobal } from './environments.js';
|
|
2
|
+
export { VitestSnapshotEnvironment } from './snapshot.js';
|
|
3
|
+
export { E as Environment, a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.CrsxCzP1.js';
|
|
4
|
+
export { VitestRunner, VitestRunnerConfig } from '@vitest/runner';
|
|
5
|
+
export { SnapshotEnvironment } from '@vitest/snapshot/environment';
|
|
6
|
+
import '@vitest/utils';
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { VitestModuleEvaluator } from './module-evaluator.js';
|
|
2
|
+
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/startModuleRunner.C5CcWyXW.js';
|
|
3
|
+
import { g as getWorkerState } from './chunks/utils.DvEY5TfP.js';
|
|
4
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.CyBMJtT7.js';
|
|
5
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.Ce0vMQM7.js';
|
|
6
|
+
import 'node:module';
|
|
7
|
+
import 'node:url';
|
|
8
|
+
import 'node:vm';
|
|
9
|
+
import 'vite/module-runner';
|
|
10
|
+
import './chunks/traces.CCmnQaNT.js';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import '@vitest/utils/helpers';
|
|
13
|
+
import './chunks/modules.BJuCwlRJ.js';
|
|
14
|
+
import 'pathe';
|
|
15
|
+
import './path.js';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import '@vitest/utils/serialize';
|
|
18
|
+
import '@vitest/mocker';
|
|
19
|
+
import '@vitest/utils/timers';
|
|
20
|
+
import 'node:console';
|
|
21
|
+
import '@vitest/snapshot/environment';
|
|
22
|
+
|
|
23
|
+
// #region internal
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
const __INTERNAL = {
|
|
28
|
+
VitestModuleEvaluator,
|
|
29
|
+
VitestModuleRunner,
|
|
30
|
+
startVitestModuleRunner,
|
|
31
|
+
VITEST_VM_CONTEXT_SYMBOL,
|
|
32
|
+
getWorkerState
|
|
33
|
+
};
|
|
34
|
+
// #endregion
|
|
35
|
+
|
|
36
|
+
export { __INTERNAL };
|
package/dist/snapshot.js
CHANGED
|
@@ -2,3 +2,5 @@ export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './ch
|
|
|
2
2
|
import '@vitest/snapshot/environment';
|
|
3
3
|
import './chunks/utils.DvEY5TfP.js';
|
|
4
4
|
import '@vitest/utils/timers';
|
|
5
|
+
|
|
6
|
+
console.warn("Importing from \"vitest/snapshot\" is deprecated since Vitest 4.1. Please use \"vitest/runtime\" instead.");
|
package/dist/suite.js
CHANGED
|
@@ -4,3 +4,5 @@ export { createChainable } from '@vitest/runner/utils';
|
|
|
4
4
|
import '@vitest/utils/helpers';
|
|
5
5
|
import './chunks/utils.DvEY5TfP.js';
|
|
6
6
|
import '@vitest/utils/timers';
|
|
7
|
+
|
|
8
|
+
console.warn("Importing from \"vitest/suite\" is deprecated since Vitest 4.1. Please use static methods of \"TestRunner\" from the \"vitest\" entry point instead: e.g., `TestRunner.getCurrentTest()`.");
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, a as WorkerSetupContext, B as BirpcOptions } from './chunks/worker.d.
|
|
1
|
+
import { W as WorkerGlobalState, a as WorkerSetupContext, B as BirpcOptions } from './chunks/worker.d.Bji1eq5g.js';
|
|
2
2
|
import { T as Traces } from './chunks/traces.d.402V_yFI.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
|
+
import { ModuleRunner } from 'vite/module-runner';
|
|
4
5
|
import { R as RuntimeRPC } from './chunks/rpc.d.RH3apGEf.js';
|
|
5
6
|
import '@vitest/runner';
|
|
6
|
-
import '
|
|
7
|
-
import './chunks/config.d.Cy95HiCx.js';
|
|
7
|
+
import './chunks/config.d.idH22YSr.js';
|
|
8
8
|
import '@vitest/pretty-format';
|
|
9
9
|
import '@vitest/snapshot';
|
|
10
10
|
import '@vitest/utils/diff';
|
|
@@ -19,6 +19,7 @@ type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, "on" | "off" | "post" | "
|
|
|
19
19
|
interface VitestWorker extends WorkerRpcOptions {
|
|
20
20
|
runTests: (state: WorkerGlobalState, traces: Traces) => Awaitable<unknown>;
|
|
21
21
|
collectTests: (state: WorkerGlobalState, traces: Traces) => Awaitable<unknown>;
|
|
22
|
+
onModuleRunner?: (moduleRunner: ModuleRunner) => Awaitable<unknown>;
|
|
22
23
|
setup?: (context: WorkerSetupContext) => Promise<() => Promise<unknown>>;
|
|
23
24
|
}
|
|
24
25
|
|