vitest 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +28 -0
- package/browser/context.d.ts +7 -1
- package/browser/context.js +5 -5
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +10 -10
- package/dist/chunks/{base.Cc3oda2V.js → base.DhkQeZwd.js} +14 -14
- package/dist/chunks/{browser.d.g5Thl309.d.ts → browser.d.3cffPS1V.d.ts} +3 -3
- package/dist/chunks/{cac.fSuRXrAx.js → cac.DfDGTQ9W.js} +13 -13
- package/dist/chunks/{cli-api.DcLieX4F.js → cli-api.C4x4GGip.js} +5 -5
- package/dist/chunks/{config.d.CU_b-wJj.d.ts → config.d.BxjInJat.d.ts} +13 -15
- package/dist/chunks/{console.B09ye7y0.js → console.RBA5x-0t.js} +3 -2
- package/dist/chunks/{coverage.AipniaqB.js → coverage.S6Dao4g-.js} +1 -1
- package/dist/chunks/{coverage.CX7NN5s7.js → coverage._yXj5zeb.js} +1 -1
- package/dist/chunks/{creator.BEj8pIIH.js → creator.203NYCo3.js} +12 -12
- package/dist/chunks/{display.pkpxlVcY.js → display.CXBnkt9a.js} +1 -1
- package/dist/chunks/{doctor.DR3u0Z_G.js → doctor.CpHPRoza.js} +2 -2
- package/dist/chunks/{environment.d.C6xYahWA.d.ts → environment.d.DAj1Vt__.d.ts} +1 -1
- package/dist/chunks/{globals.D9ucJdZZ.js → globals.9QtHn8Sr.js} +9 -9
- package/dist/chunks/{index.m3L2HgmY.js → index.C4tKZ0yW.js} +29 -15
- package/dist/chunks/{index.DzobfTyw.js → index.DpLw24bj.js} +177 -85
- package/dist/chunks/{index.M2dsQ_UQ.js → index.cx-_w29y.js} +551 -179
- package/dist/chunks/{index.DNv8WNGe.js → index.ggMXe2IF.js} +17 -7
- package/dist/chunks/{index.D4dXTzh9.js → index.k8L_ZRzq.js} +24 -7
- package/dist/chunks/{init-forks.DgHqDQHC.js → init-forks.hzLs7kMZ.js} +1 -1
- package/dist/chunks/{init-threads.B-t1iYCi.js → init-threads.COb0VD5D.js} +1 -1
- package/dist/chunks/{init.3UJvPvQg.js → init.D0qF-GGk.js} +4 -5
- package/dist/chunks/{native.CF4uT5hY.js → native.CBlba4VV.js} +2 -2
- package/dist/chunks/{nativeModuleMocker.B20FEd-E.js → nativeModuleMocker.CXSh3m91.js} +2 -2
- package/dist/chunks/{nativeModuleRunner.J0QLzNtK.js → nativeModuleRunner.jwZPY3dg.js} +1 -1
- package/dist/chunks/{node.CfQ_OGWr.js → node.BzimPqT5.js} +1 -1
- package/dist/chunks/{pathe.M-eThtNZ.DwEga6ro.js → pathe.M-eThtNZ.CknpM8Or.js} +1 -1
- package/dist/chunks/{plugin.d.CN87HSxv.d.ts → plugin.d.BsjqSb4-.d.ts} +35 -27
- package/dist/chunks/{plugins.Cigb0uSy.js → plugins.D2ut1V9b.js} +1 -1
- package/dist/chunks/{resolver.NpfwMKt9.js → resolver.fbW9AUvG.js} +1 -1
- package/dist/chunks/{rpc.Bvs-iVxs.js → rpc.BTmCtPly.js} +8 -6
- package/dist/chunks/{rpc.d.DA9Utv4e.d.ts → rpc.d.BPFHl-HE.d.ts} +1 -1
- package/dist/chunks/{run.C5UmxDPh.js → run.BTlFXlnv.js} +29 -19
- package/dist/chunks/{setup-common.BkQOiNcI.js → setup-common.BglbuAHD.js} +3 -3
- package/dist/chunks/{source-map.BH0bbrs9.js → source-map.DUxvo12T.js} +4 -8
- package/dist/chunks/{source-map.d.YqWNcp4e.d.ts → source-map.d.BLHtC2OB.d.ts} +1 -1
- package/dist/chunks/{spy.DQ0ZsPbi.js → spy.DgMTfhrK.js} +21 -18
- package/dist/chunks/{task-utils.d.BZm4GSQD.d.ts → task-utils.d.C-IeGxLU.d.ts} +1 -1
- package/dist/chunks/{utils.CJ0JImL8.js → utils.RcGwuOc_.js} +2 -2
- package/dist/chunks/{vm.W4G5WMTl.js → vm.vTyZj_02.js} +8 -8
- package/dist/chunks/{worker.d.MLmnzOJE.d.ts → worker.d.Bt2A2mmi.d.ts} +3 -3
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +9 -9
- package/dist/index.d.ts +10 -10
- package/dist/index.js +9 -9
- package/dist/module-evaluator.d.ts +3 -2
- package/dist/module-evaluator.js +8 -5
- package/dist/node.d.ts +9 -9
- package/dist/node.js +14 -14
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +4 -4
- package/dist/spy.js +1 -1
- package/dist/task-utils.js +2 -1
- package/dist/worker.d.ts +4 -4
- package/dist/worker.js +17 -17
- package/dist/workers/forks.js +18 -18
- package/dist/workers/runVmTests.js +14 -14
- package/dist/workers/threads.js +18 -18
- package/dist/workers/vmForks.js +12 -12
- package/dist/workers/vmThreads.js +12 -12
- package/globals.d.ts +19 -19
- package/index.cjs +3 -3
- package/optional-runtime-types.d.ts +1 -1
- package/optional-types.d.ts +1 -1
- package/package.json +22 -17
- package/suppress-warnings.cjs +1 -1
|
@@ -6,6 +6,7 @@ const MOCK_RESTORE = /* @__PURE__ */ new Set();
|
|
|
6
6
|
// but it makes the state slower to access and return different values
|
|
7
7
|
// if you stored it before calling `mockClear` where it will be recreated
|
|
8
8
|
const DIRTY_MOCK_STATES = /* @__PURE__ */ new Set();
|
|
9
|
+
const addDirtyMock = DIRTY_MOCK_STATES.add.bind(DIRTY_MOCK_STATES);
|
|
9
10
|
const REGISTERED_MOCKS = /* @__PURE__ */ new Set();
|
|
10
11
|
const MOCK_FINALIZER = new FinalizationRegistry((ref) => {
|
|
11
12
|
REGISTERED_MOCKS.delete(ref);
|
|
@@ -104,13 +105,13 @@ function createMockInstance(options = {}) {
|
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
107
|
mock.mockThrow = function mockThrow(value) {
|
|
107
|
-
//
|
|
108
|
+
// oxlint-disable-next-line prefer-arrow-callback
|
|
108
109
|
return mock.mockImplementation(function() {
|
|
109
110
|
throw value;
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
113
|
mock.mockThrowOnce = function mockThrowOnce(value) {
|
|
113
|
-
//
|
|
114
|
+
// oxlint-disable-next-line prefer-arrow-callback
|
|
114
115
|
return mock.mockImplementationOnce(function() {
|
|
115
116
|
throw value;
|
|
116
117
|
});
|
|
@@ -267,9 +268,9 @@ function createMock({ state, config, name: mockName, prototypeState, prototypeCo
|
|
|
267
268
|
const prototypeMock = prototypeState && MOCKS_BY_STATE.get(prototypeState);
|
|
268
269
|
const namedObject = {
|
|
269
270
|
// to keep the name of the function intact
|
|
270
|
-
[name]:
|
|
271
|
-
|
|
272
|
-
if (prototypeMock)
|
|
271
|
+
[name]: function(...args) {
|
|
272
|
+
addDirtyMock(namedObject[name]);
|
|
273
|
+
if (prototypeMock) addDirtyMock(prototypeMock);
|
|
273
274
|
registerCalls(args, state, prototypeState);
|
|
274
275
|
registerInvocationOrder(invocationCallCounter++, state, prototypeState);
|
|
275
276
|
const result = {
|
|
@@ -294,9 +295,11 @@ function createMock({ state, config, name: mockName, prototypeState, prototypeCo
|
|
|
294
295
|
// the prototype chain is already prepared when the implementation
|
|
295
296
|
// is registered, but a consumed `mockImplementationOnce` can change
|
|
296
297
|
// which implementation this construction uses
|
|
297
|
-
if (prototypeMembers.length === 0)
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
if (prototypeMembers.length === 0) reparentMockPrototype(
|
|
299
|
+
// oxlint-disable-next-line typescript/no-use-before-define
|
|
300
|
+
mock,
|
|
301
|
+
implementation === noopImplementation ? void 0 : implementation
|
|
302
|
+
);
|
|
300
303
|
returnValue = Reflect.construct(implementation, args, new.target);
|
|
301
304
|
// jest calls this before the implementation, but we have to resolve this _after_
|
|
302
305
|
// because we cannot do it before the `Reflect.construct` called the custom implementation.
|
|
@@ -305,7 +308,7 @@ function createMock({ state, config, name: mockName, prototypeState, prototypeCo
|
|
|
305
308
|
for (const prop of prototypeMembers) {
|
|
306
309
|
const prototypeMock = returnValue[prop];
|
|
307
310
|
// the method was overridden because of inheritance, ignore it
|
|
308
|
-
//
|
|
311
|
+
// oxlint-disable-next-line typescript/no-use-before-define
|
|
309
312
|
if (prototypeMock !== mock.prototype[prop]) continue;
|
|
310
313
|
const isMock = isMockFunction(prototypeMock);
|
|
311
314
|
const prototypeState = isMock ? prototypeMock.mock : void 0;
|
|
@@ -352,7 +355,7 @@ function createMock({ state, config, name: mockName, prototypeState, prototypeCo
|
|
|
352
355
|
}
|
|
353
356
|
}
|
|
354
357
|
return returnValue;
|
|
355
|
-
}
|
|
358
|
+
} };
|
|
356
359
|
const mock = namedObject[name];
|
|
357
360
|
const copyPropertiesFrom = original || pseudoOriginal;
|
|
358
361
|
if (copyPropertiesFrom) copyOriginalStaticProperties(mock, copyPropertiesFrom);
|
|
@@ -464,14 +467,14 @@ function throwConstructorError(shorthand) {
|
|
|
464
467
|
}
|
|
465
468
|
|
|
466
469
|
var spyModule = /*#__PURE__*/Object.freeze({
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
470
|
+
__proto__: null,
|
|
471
|
+
clearAllMocks: clearAllMocks,
|
|
472
|
+
createMockInstance: createMockInstance,
|
|
473
|
+
fn: fn,
|
|
474
|
+
isMockFunction: isMockFunction,
|
|
475
|
+
resetAllMocks: resetAllMocks,
|
|
476
|
+
restoreAllMocks: restoreAllMocks,
|
|
477
|
+
spyOn: spyOn
|
|
475
478
|
});
|
|
476
479
|
|
|
477
480
|
export { spyOn as a, resetAllMocks as b, clearAllMocks as c, createMockInstance as d, fn as f, isMockFunction as i, restoreAllMocks as r, spyModule as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bn as SnapshotState, m as Test, bo as PromisifyAssertion, bp as Tester, bq as Plugin, ad as BenchResult, a as File } from './config.d.
|
|
1
|
+
import { bn as SnapshotState, m as Test, bo as PromisifyAssertion, bp as Tester, bq as Plugin, ad as BenchResult, a as File } from './config.d.BxjInJat.js';
|
|
2
2
|
|
|
3
3
|
interface SnapshotMatcher<
|
|
4
4
|
R extends void | Promise<void>,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { stripVTControlCharacters } from 'node:util';
|
|
2
|
-
import { t as truncateString$1 } from './display.
|
|
3
|
-
import { i as isAbsolute, a as relative, d as dirname, b as basename, s as slash } from './pathe.M-eThtNZ.
|
|
2
|
+
import { t as truncateString$1 } from './display.CXBnkt9a.js';
|
|
3
|
+
import { i as isAbsolute, a as relative, d as dirname, b as basename, s as slash } from './pathe.M-eThtNZ.CknpM8Or.js';
|
|
4
4
|
import { y } from './tinyrainbow.Ht9iggcq.js';
|
|
5
5
|
|
|
6
6
|
const F_RIGHT = "→";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
2
|
import v8 from 'node:v8';
|
|
3
3
|
import vm, { isContext, runInContext } from 'node:vm';
|
|
4
|
-
import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.
|
|
4
|
+
import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.D0qF-GGk.js';
|
|
5
5
|
import { distDir } from '../path.js';
|
|
6
|
-
import { createCustomConsole } from './console.
|
|
6
|
+
import { createCustomConsole } from './console.RBA5x-0t.js';
|
|
7
7
|
import fs__default from 'node:fs';
|
|
8
8
|
import { createRequire, Module, isBuiltin } from 'node:module';
|
|
9
|
-
import { d as dirname, f as extname, b as basename, C as CSS_LANGS_RE, h as KNOWN_ASSET_RE, t as toArray, k as splitFileAndPostfix, n as normalize, l as isBareImport, r as resolve } from './pathe.M-eThtNZ.
|
|
10
|
-
import { l as lookupPackageScopeType } from './resolver.
|
|
9
|
+
import { d as dirname, f as extname, b as basename, C as CSS_LANGS_RE, h as KNOWN_ASSET_RE, t as toArray, k as splitFileAndPostfix, n as normalize, l as isBareImport, r as resolve } from './pathe.M-eThtNZ.CknpM8Or.js';
|
|
10
|
+
import { l as lookupPackageScopeType } from './resolver.fbW9AUvG.js';
|
|
11
11
|
import { initSync, parse } from 'es-module-lexer';
|
|
12
12
|
import { dirname as dirname$1 } from 'node:path';
|
|
13
|
-
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, c as createNodeImportMeta } from './index.
|
|
13
|
+
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, c as createNodeImportMeta } from './index.k8L_ZRzq.js';
|
|
14
14
|
import { getDefaultRequestStubs } from '../module-evaluator.js';
|
|
15
|
-
import { b as setupEnv } from './setup-common.
|
|
15
|
+
import { b as setupEnv } from './setup-common.BglbuAHD.js';
|
|
16
16
|
import { p as provideWorkerState } from './utils.DYj33du9.js';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -219,7 +219,7 @@ class CommonjsExecutor {
|
|
|
219
219
|
this.shouldRequireAsEsm = options.shouldRequireAsEsm;
|
|
220
220
|
this.requireEsm = options.requireEsm;
|
|
221
221
|
const primitives = vm.runInContext("({ Object, Array, Error })", this.context);
|
|
222
|
-
//
|
|
222
|
+
// oxlint-disable-next-line typescript/no-this-alias
|
|
223
223
|
const executor = this;
|
|
224
224
|
this.Module = class Module$1 {
|
|
225
225
|
exports;
|
|
@@ -434,7 +434,7 @@ class CommonjsExecutor {
|
|
|
434
434
|
let currentExtension;
|
|
435
435
|
let index;
|
|
436
436
|
let startIndex = 0;
|
|
437
|
-
//
|
|
437
|
+
// oxlint-disable-next-line no-cond-assign
|
|
438
438
|
while ((index = name.indexOf(".", startIndex)) !== -1) {
|
|
439
439
|
startIndex = index + 1;
|
|
440
440
|
if (index === 0) continue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EvaluatedModules } from 'vite/module-runner';
|
|
2
|
-
import { F as FileSpecification, b as SerializedConfig, X as Task, Y as CancelReason } from './config.d.
|
|
3
|
-
import { a as RuntimeRPC, R as RunnerRPC, G as GetterTracker } from './rpc.d.
|
|
4
|
-
import { E as Environment } from './environment.d.
|
|
2
|
+
import { F as FileSpecification, b as SerializedConfig, X as Task, Y as CancelReason } from './config.d.BxjInJat.js';
|
|
3
|
+
import { a as RuntimeRPC, R as RunnerRPC, G as GetterTracker } from './rpc.d.BPFHl-HE.js';
|
|
4
|
+
import { E as Environment } from './environment.d.DAj1Vt__.js';
|
|
5
5
|
|
|
6
6
|
//#region src/messages.d.ts
|
|
7
7
|
declare const TYPE_REQUEST: "q";
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as createCLI } from './chunks/cac.
|
|
2
|
-
import './chunks/pathe.M-eThtNZ.
|
|
1
|
+
import { c as createCLI } from './chunks/cac.DfDGTQ9W.js';
|
|
2
|
+
import './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
3
3
|
import 'events';
|
|
4
4
|
import './chunks/tinyrainbow.Ht9iggcq.js';
|
|
5
5
|
import './chunks/env.DzFJjrmK.js';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { HookHandler, UserConfig, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.
|
|
3
|
+
import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.BsjqSb4-.js';
|
|
4
4
|
import { InlineConfig, ResolvedConfig, VitestPluginContext, CoverageOptions } from './node.js';
|
|
5
|
-
export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.
|
|
6
|
-
import { C as Config } from './chunks/config.d.
|
|
7
|
-
export { e as TestTagDefinition } from './chunks/config.d.
|
|
5
|
+
export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.BsjqSb4-.js';
|
|
6
|
+
import { C as Config } from './chunks/config.d.BxjInJat.js';
|
|
7
|
+
export { e as TestTagDefinition } from './chunks/config.d.BxjInJat.js';
|
|
8
8
|
import 'node:stream';
|
|
9
|
-
import './chunks/browser.d.
|
|
10
|
-
import './chunks/rpc.d.
|
|
9
|
+
import './chunks/browser.d.3cffPS1V.js';
|
|
10
|
+
import './chunks/rpc.d.BPFHl-HE.js';
|
|
11
11
|
import 'vite/module-runner';
|
|
12
|
-
import './chunks/worker.d.
|
|
13
|
-
import './chunks/environment.d.
|
|
12
|
+
import './chunks/worker.d.Bt2A2mmi.js';
|
|
13
|
+
import './chunks/environment.d.DAj1Vt__.js';
|
|
14
14
|
import 'chai';
|
|
15
15
|
import 'vitest/optional-types.js';
|
|
16
16
|
import '@vitest/mocker';
|
|
17
|
-
import './chunks/source-map.d.
|
|
17
|
+
import './chunks/source-map.d.BLHtC2OB.js';
|
|
18
18
|
import 'vitest/browser';
|
|
19
19
|
import 'node:path';
|
|
20
20
|
import 'node:console';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { a as File, A as Awaitable, g as TestAnnotation, h as TestArtifact, j as TaskResultPack, k as TaskEventPack, U as UserConsoleLog, l as SerializedRootConfig, L as LabelColor, M as ModuleGraphData, m as Test, n as TaskPopulated, E as ExpectStatic, o as ProvidedContext, p as MatcherState, q as SyncExpectationResult, r as AsyncExpectationResult, t as DomainSnapshotAdapter, u as ExpectationResult, v as Procedure, w as Mock, C as Config, x as spyOn, y as fn, z as MaybeMockedDeep, B as MaybeMocked, G as MaybePartiallyMocked, H as MaybePartiallyMockedDeep, I as MockInstance, R as RuntimeOptions, J as TestAPI, K as SuiteCollector, N as SuiteAPI, O as Suite, Q as SuiteHooks, V as VitestRunner, b as SerializedConfig, W as VitestRunnerImportSource, X as Task, Y as CancelReason, Z as TestTryOptions, $ as TestContext, a0 as ImportDuration, a1 as createChainable } from './chunks/config.d.
|
|
2
|
-
export { a2 as AfterSuiteRunMeta, a3 as Assertion, a4 as AsymmetricMatchersContaining, a5 as BaselineData, a6 as Bench, a7 as BenchFn, a8 as BenchFnOptions, a9 as BenchFromSource, aa as BenchOptions, ab as BenchRegistration, ac as BenchRegistrationInput, ad as BenchResult, ae as BenchRunOptions, af as BenchStorage, ag as BenchmarkGroup, ah as BenchmarkProvider, ai as BrowserTraceArtifact, aj as DeeplyAllowMatchers, D as DiffOptions, ak as DomainMatchResult, al as FailureScreenshotArtifact, am as JestAssertion, an as Matcher, ao as Matchers, ap as MatchersObject, aq as MockContext, ar as MockResult, as as MockResultIncomplete, at as MockResultReturn, au as MockResultThrow, av as MockSettledResult, aw as MockSettledResultFulfilled, ax as MockSettledResultIncomplete, ay as MockSettledResultRejected, az as Mocked, aA as MockedClass, aB as MockedFunction, aC as MockedObject, aD as OnTestFailedHandler, aE as OnTestFinishedHandler, P as ParsedStack, aF as RunMode, aG as RunnerTaskBase, aH as RunnerTaskResult, aI as RuntimeConfig, S as SerializedCoverageConfig, aJ as SerializedError, aK as SnapshotData, aL as SnapshotMatchOptions, aM as SnapshotResult, aN as SnapshotSerializer, aO as SnapshotStateOptions, aP as SnapshotSummary, aQ as SnapshotUpdateState, aR as SuiteFactory, aS as SuiteOptions, aT as TaskCustomOptions, aU as TaskMeta, aV as TaskState, aW as TestAnnotationArtifact, aX as TestAnnotationLocation, aY as TestArtifactBase, aZ as TestArtifactLocation, a_ as TestArtifactRegistry, a$ as TestAttachment, b0 as TestBenchmark, b1 as TestBenchmarkTask, T as TestError, b2 as TestFunction, b3 as TestOptions, e as TestTagDefinition, b4 as TestTags, b5 as UncheckedSnapshot, b6 as VisualRegressionArtifact, b7 as afterAll, b8 as afterEach, b9 as aroundAll, ba as aroundEach, bb as beforeAll, bc as beforeEach, bd as onTestFailed, be as onTestFinished } from './chunks/config.d.
|
|
3
|
-
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.
|
|
4
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
5
|
-
import { c as createFileTask } from './chunks/task-utils.d.
|
|
6
|
-
import { B as BirpcReturn } from './chunks/worker.d.
|
|
7
|
-
export { C as ContextRPC, a as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
1
|
+
import { a as File, A as Awaitable, g as TestAnnotation, h as TestArtifact, j as TaskResultPack, k as TaskEventPack, U as UserConsoleLog, l as SerializedRootConfig, L as LabelColor, M as ModuleGraphData, m as Test, n as TaskPopulated, E as ExpectStatic, o as ProvidedContext, p as MatcherState, q as SyncExpectationResult, r as AsyncExpectationResult, t as DomainSnapshotAdapter, u as ExpectationResult, v as Procedure, w as Mock, C as Config, x as spyOn, y as fn, z as MaybeMockedDeep, B as MaybeMocked, G as MaybePartiallyMocked, H as MaybePartiallyMockedDeep, I as MockInstance, R as RuntimeOptions, J as TestAPI, K as SuiteCollector, N as SuiteAPI, O as Suite, Q as SuiteHooks, V as VitestRunner, b as SerializedConfig, W as VitestRunnerImportSource, X as Task, Y as CancelReason, Z as TestTryOptions, $ as TestContext, a0 as ImportDuration, a1 as createChainable } from './chunks/config.d.BxjInJat.js';
|
|
2
|
+
export { a2 as AfterSuiteRunMeta, a3 as Assertion, a4 as AsymmetricMatchersContaining, a5 as BaselineData, a6 as Bench, a7 as BenchFn, a8 as BenchFnOptions, a9 as BenchFromSource, aa as BenchOptions, ab as BenchRegistration, ac as BenchRegistrationInput, ad as BenchResult, ae as BenchRunOptions, af as BenchStorage, ag as BenchmarkGroup, ah as BenchmarkProvider, ai as BrowserTraceArtifact, aj as DeeplyAllowMatchers, D as DiffOptions, ak as DomainMatchResult, al as FailureScreenshotArtifact, am as JestAssertion, an as Matcher, ao as Matchers, ap as MatchersObject, aq as MockContext, ar as MockResult, as as MockResultIncomplete, at as MockResultReturn, au as MockResultThrow, av as MockSettledResult, aw as MockSettledResultFulfilled, ax as MockSettledResultIncomplete, ay as MockSettledResultRejected, az as Mocked, aA as MockedClass, aB as MockedFunction, aC as MockedObject, aD as OnTestFailedHandler, aE as OnTestFinishedHandler, P as ParsedStack, aF as RunMode, aG as RunnerTaskBase, aH as RunnerTaskResult, aI as RuntimeConfig, S as SerializedCoverageConfig, aJ as SerializedError, aK as SnapshotData, aL as SnapshotMatchOptions, aM as SnapshotResult, aN as SnapshotSerializer, aO as SnapshotStateOptions, aP as SnapshotSummary, aQ as SnapshotUpdateState, aR as SuiteFactory, aS as SuiteOptions, aT as TaskCustomOptions, aU as TaskMeta, aV as TaskState, aW as TestAnnotationArtifact, aX as TestAnnotationLocation, aY as TestArtifactBase, aZ as TestArtifactLocation, a_ as TestArtifactRegistry, a$ as TestAttachment, b0 as TestBenchmark, b1 as TestBenchmarkTask, T as TestError, b2 as TestFunction, b3 as TestOptions, e as TestTagDefinition, b4 as TestTags, b5 as UncheckedSnapshot, b6 as VisualRegressionArtifact, b7 as afterAll, b8 as afterEach, b9 as aroundAll, ba as aroundEach, bb as beforeAll, bc as beforeEach, bd as onTestFailed, be as onTestFinished } from './chunks/config.d.BxjInJat.js';
|
|
3
|
+
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.3cffPS1V.js';
|
|
4
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.3cffPS1V.js';
|
|
5
|
+
import { c as createFileTask } from './chunks/task-utils.d.C-IeGxLU.js';
|
|
6
|
+
import { B as BirpcReturn } from './chunks/worker.d.Bt2A2mmi.js';
|
|
7
|
+
export { C as ContextRPC, a as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.Bt2A2mmi.js';
|
|
8
8
|
import { Disposable } from 'vitest/optional-runtime-types.js';
|
|
9
9
|
import { ModuleMockFactoryWithHelper, ModuleMockOptions } from '@vitest/mocker';
|
|
10
10
|
export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
|
|
11
|
-
import { T as Traces } from './chunks/rpc.d.
|
|
12
|
-
export { R as RunnerRPC, a as RuntimeRPC } from './chunks/rpc.d.
|
|
11
|
+
import { T as Traces } from './chunks/rpc.d.BPFHl-HE.js';
|
|
12
|
+
export { R as RunnerRPC, a as RuntimeRPC } from './chunks/rpc.d.BPFHl-HE.js';
|
|
13
13
|
export { ExpectTypeOf, expectTypeOf } from 'expect-type';
|
|
14
14
|
export { BenchOptions as BenchCompareOptions } from 'tinybench';
|
|
15
15
|
import * as chai from 'chai';
|
|
16
16
|
export { chai };
|
|
17
17
|
import 'vite/module-runner';
|
|
18
|
-
import './chunks/environment.d.
|
|
18
|
+
import './chunks/environment.d.DAj1Vt__.js';
|
|
19
19
|
|
|
20
20
|
interface SourceMap {
|
|
21
21
|
file: string;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.
|
|
2
|
-
export { V as EvaluatedModules } from './chunks/rpc.
|
|
3
|
-
export { j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './chunks/run.
|
|
1
|
+
export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.C4tKZ0yW.js';
|
|
2
|
+
export { V as EvaluatedModules } from './chunks/rpc.BTmCtPly.js';
|
|
3
|
+
export { j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './chunks/run.BTlFXlnv.js';
|
|
4
4
|
export { expectTypeOf } from 'expect-type';
|
|
5
5
|
import * as chai from 'chai';
|
|
6
6
|
export { chai };
|
|
7
7
|
import './chunks/utils.DYj33du9.js';
|
|
8
|
-
import './chunks/source-map.
|
|
9
|
-
import './chunks/
|
|
10
|
-
import './chunks/spy.DQ0ZsPbi.js';
|
|
11
|
-
import './chunks/display.pkpxlVcY.js';
|
|
12
|
-
import './chunks/index.M2dsQ_UQ.js';
|
|
8
|
+
import './chunks/source-map.DUxvo12T.js';
|
|
9
|
+
import './chunks/index.cx-_w29y.js';
|
|
13
10
|
import './chunks/tinyrainbow.Ht9iggcq.js';
|
|
11
|
+
import './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
12
|
+
import './chunks/spy.DgMTfhrK.js';
|
|
13
|
+
import './chunks/display.CXBnkt9a.js';
|
|
14
14
|
import './task-utils.js';
|
|
15
|
-
import './chunks/plugins.
|
|
15
|
+
import './chunks/plugins.D2ut1V9b.js';
|
|
16
16
|
import './chunks/offset.Dy-5Fdfn.js';
|
|
17
17
|
import 'tinybench';
|
|
18
18
|
import 'vite/module-runner';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
|
|
2
|
-
import { G as GetterTracker } from './chunks/rpc.d.
|
|
2
|
+
import { G as GetterTracker } from './chunks/rpc.d.BPFHl-HE.js';
|
|
3
3
|
import { RuntimeRPC } from './index.js';
|
|
4
4
|
import { EvaluatedModules as VitestEvaluatedModules } from './index.js';
|
|
5
5
|
import vm from 'node:vm';
|
|
6
|
-
import './chunks/config.d.
|
|
6
|
+
import './chunks/config.d.BxjInJat.js';
|
|
7
7
|
import 'vitest/optional-runtime-types.js';
|
|
8
8
|
import 'tinybench';
|
|
9
9
|
|
|
@@ -155,6 +155,7 @@ interface VitestModuleEvaluatorOptions {
|
|
|
155
155
|
injectCjsGlobals?: boolean | undefined;
|
|
156
156
|
moduleExecutionInfo?: ModuleExecutionInfo;
|
|
157
157
|
getCurrentTestFilepath?: () => string | undefined;
|
|
158
|
+
getEnvironmentName?: () => string;
|
|
158
159
|
compiledFunctionArgumentsNames?: string[];
|
|
159
160
|
compiledFunctionArgumentsValues?: unknown[];
|
|
160
161
|
getterTracker?: GetterTracker;
|
package/dist/module-evaluator.js
CHANGED
|
@@ -37,13 +37,16 @@ const isWindows = process.platform === "win32";
|
|
|
37
37
|
// holds no per-context state (Vite rewrites dynamic imports to
|
|
38
38
|
// `__vite_ssr_dynamic_import__`, so no per-context import callback is baked
|
|
39
39
|
// in) — only its evaluation has to happen per context. Keyed by module id
|
|
40
|
-
// (`mock:` ids stay distinct from their originals)
|
|
40
|
+
// (`mock:` ids stay distinct from their originals) and Vite environment: one
|
|
41
|
+
// worker can run files of different environments, which transform the same id
|
|
42
|
+
// differently.
|
|
41
43
|
const vmInlineScriptCache = /* @__PURE__ */ new Map();
|
|
42
|
-
function getVmInlineScript(id, wrappedCode, options) {
|
|
43
|
-
|
|
44
|
+
function getVmInlineScript(environment, id, wrappedCode, options) {
|
|
45
|
+
const key = `${environment}:${id}`;
|
|
46
|
+
let script = vmInlineScriptCache.get(key);
|
|
44
47
|
if (!script) {
|
|
45
48
|
script = new vm.Script(wrappedCode, options);
|
|
46
|
-
vmInlineScriptCache.set(
|
|
49
|
+
vmInlineScriptCache.set(key, script);
|
|
47
50
|
}
|
|
48
51
|
return script;
|
|
49
52
|
}
|
|
@@ -255,7 +258,7 @@ get: () => globalNamespace.__vitest_index__ });
|
|
|
255
258
|
importer
|
|
256
259
|
});
|
|
257
260
|
try {
|
|
258
|
-
await (this.vm ? getVmInlineScript(module.id, wrappedCode, options).runInContext(this.vm.context) : vm.runInThisContext(wrappedCode, options))(...argumentsValues);
|
|
261
|
+
await (this.vm ? getVmInlineScript(this.options.getEnvironmentName?.() ?? "", module.id, wrappedCode, options).runInContext(this.vm.context) : vm.runInThisContext(wrappedCode, options))(...argumentsValues);
|
|
259
262
|
} catch (error) {
|
|
260
263
|
if (!injectCjsGlobals) throw enhanceMissingCjsGlobalsError(error);
|
|
261
264
|
throw error;
|
package/dist/node.d.ts
CHANGED
|
@@ -3,24 +3,24 @@ import { UserConfig as UserConfig$1, ResolvedConfig as ResolvedConfig$1, Transfo
|
|
|
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 { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as ReportContext, j as TestProject, k as VitestOptions, l as VitestRunMode, m as TestSpecification, n as PoolWorker, o as PoolOptions, p as WorkerRequest, q as TestSequencer } from './chunks/plugin.d.
|
|
7
|
-
export { M as AgentReporter, B as BaseCoverageOptions, r as BaseReporter, s as BenchmarkUserOptions, t as BrowserBuiltinProvider, u as BrowserCommand, v as BrowserCommandContext, w as BrowserConfigOptions, x as BrowserInstanceOption, y as BrowserModuleMocker, z as BrowserOrchestrator, D as BrowserProvider, E as BrowserProviderOption, G as BrowserScript, H as BrowserServerContribution, J as BrowserServerFactory, K as BrowserServerState, N as BrowserServerStateSession, O as BrowserTraceViewOptions, Q as BuiltinEnvironment, S as BuiltinReporterOptions, X as BuiltinReporters, Y as CSSModuleScopeStrategy, Z as CacheKeyIdGenerator, _ as CacheKeyIdGeneratorContext, $ as CoverageInstrumenter, a0 as CoverageIstanbulOptions, C as CoverageOptions, a1 as CoverageProvider, a2 as CoverageProviderModule, a3 as CoverageReporter, a4 as CoverageV8Options, a5 as CustomProviderOptions, a6 as DefaultReporter, a7 as DepsOptimizationOptions, a8 as DotReporter, a9 as EnvironmentOptions, aa as GithubActionsReporter, ab as HTMLOptions, ac as HangingProcessReporter, I as InlineConfig, ad as InstrumenterOptions, ae as JUnitOptions, af as JUnitReporter, ag as JsonAssertionResult, ah as JsonOptions, ai as JsonReporter, aj as JsonTestResult, ak as JsonTestResults, M as MinimalReporter, al as ModuleDiagnostic, am as OnServerRestartHandler, an as OnTestsRerunHandler, ao as ParentProjectBrowser, ap as Pool, aq as PoolRunnerInitializer, ar as PoolTask, as as ProjectBrowser, at as ProjectConfig, au as Report, av as ReportedHookContext, aw as Reporter, ax as ReportersMap, ay as ResolveSnapshotPathHandler, az as ResolveSnapshotPathHandlerContext, aA as ResolvedBrowserOptions, aB as ResolvedProjectConfig, aC as SerializedTestProject, aD as SuiteNameTemplateVariables, aE as TapFlatReporter, aF as TapReporter, aG as TaskOptions, aH as TestCase, aI as TestCollection, aJ as TestDiagnostic, aK as TestModule, aL as TestModuleState, aM as TestResult, aN as TestResultFailed, aO as TestResultPassed, aP as TestResultPending, aQ as TestResultSkipped, aR as TestRunEndReason, aS as TestRunResult, aT as TestSequencerConstructor, aU as TestSpecificationOptions, aV as TestState, aW as TestSuite, aX as TestSuiteState, aY as ToMatchScreenshotComparators, aZ as ToMatchScreenshotOptions, a_ as TypecheckConfig, U as UserWorkspaceConfig, a$ as VerboseReporter, b0 as VitestEnvironment, b1 as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, b2 as WorkerResponse, b3 as _BrowserNames, b4 as experimental_getRunnerTask, b5 as startVitest } from './chunks/plugin.d.
|
|
6
|
+
import { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as ReportContext, j as TestProject, k as VitestOptions, l as VitestRunMode, m as TestSpecification, n as PoolWorker, o as PoolOptions, p as WorkerRequest, q as TestSequencer } from './chunks/plugin.d.BsjqSb4-.js';
|
|
7
|
+
export { M as AgentReporter, B as BaseCoverageOptions, r as BaseReporter, s as BenchmarkUserOptions, t as BrowserBuiltinProvider, u as BrowserCommand, v as BrowserCommandContext, w as BrowserConfigOptions, x as BrowserInstanceOption, y as BrowserModuleMocker, z as BrowserOrchestrator, D as BrowserProvider, E as BrowserProviderOption, G as BrowserScript, H as BrowserServerContribution, J as BrowserServerFactory, K as BrowserServerState, N as BrowserServerStateSession, O as BrowserTraceViewOptions, Q as BuiltinEnvironment, S as BuiltinReporterOptions, X as BuiltinReporters, Y as CSSModuleScopeStrategy, Z as CacheKeyIdGenerator, _ as CacheKeyIdGeneratorContext, $ as CoverageInstrumenter, a0 as CoverageIstanbulOptions, C as CoverageOptions, a1 as CoverageProvider, a2 as CoverageProviderModule, a3 as CoverageReporter, a4 as CoverageV8Options, a5 as CustomProviderOptions, a6 as DefaultReporter, a7 as DepsOptimizationOptions, a8 as DotReporter, a9 as EnvironmentOptions, aa as GithubActionsReporter, ab as HTMLOptions, ac as HangingProcessReporter, I as InlineConfig, ad as InstrumenterOptions, ae as JUnitOptions, af as JUnitReporter, ag as JsonAssertionResult, ah as JsonOptions, ai as JsonReporter, aj as JsonTestResult, ak as JsonTestResults, M as MinimalReporter, al as ModuleDiagnostic, am as OnServerRestartHandler, an as OnTestsRerunHandler, ao as ParentProjectBrowser, ap as Pool, aq as PoolRunnerInitializer, ar as PoolTask, as as ProjectBrowser, at as ProjectConfig, au as Report, av as ReportedHookContext, aw as Reporter, ax as ReportersMap, ay as ResolveSnapshotPathHandler, az as ResolveSnapshotPathHandlerContext, aA as ResolvedBrowserOptions, aB as ResolvedProjectConfig, aC as SerializedTestProject, aD as SuiteNameTemplateVariables, aE as TapFlatReporter, aF as TapReporter, aG as TaskOptions, aH as TestCase, aI as TestCollection, aJ as TestDiagnostic, aK as TestModule, aL as TestModuleState, aM as TestResult, aN as TestResultFailed, aO as TestResultPassed, aP as TestResultPending, aQ as TestResultSkipped, aR as TestRunEndReason, aS as TestRunResult, aT as TestSequencerConstructor, aU as TestSpecificationOptions, aV as TestState, aW as TestSuite, aX as TestSuiteState, aY as ToMatchScreenshotComparators, aZ as ToMatchScreenshotOptions, a_ as TypecheckConfig, U as UserWorkspaceConfig, a$ as VerboseReporter, b0 as VitestEnvironment, b1 as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, b2 as WorkerResponse, b3 as _BrowserNames, b4 as experimental_getRunnerTask, b5 as startVitest } from './chunks/plugin.d.BsjqSb4-.js';
|
|
8
8
|
import { EventEmitter } from 'events';
|
|
9
|
-
import { A as Awaitable } from './chunks/config.d.
|
|
9
|
+
import { A as Awaitable } from './chunks/config.d.BxjInJat.js';
|
|
10
10
|
import { AfterSuiteRunMeta } from './index.js';
|
|
11
|
-
export { X as RunnerTask, aH as RunnerTaskResult, j as RunnerTaskResultPack, m as RunnerTestCase, a as RunnerTestFile, O as RunnerTestSuite, aI as RuntimeConfig, bf as SequenceHooks, bg as SequenceSetupFiles, aJ as SerializedError, bh as disableDefaultColors } from './chunks/config.d.
|
|
11
|
+
export { X as RunnerTask, aH as RunnerTaskResult, j as RunnerTaskResultPack, m as RunnerTestCase, a as RunnerTestFile, O as RunnerTestSuite, aI as RuntimeConfig, bf as SequenceHooks, bg as SequenceSetupFiles, aJ as SerializedError, bh as disableDefaultColors } from './chunks/config.d.BxjInJat.js';
|
|
12
12
|
import { RuntimeRPC } from './index.js';
|
|
13
13
|
import { Writable } from 'node:stream';
|
|
14
14
|
import { ContextRPC } from './index.js';
|
|
15
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
15
|
+
export { T as TestExecutionType } from './chunks/worker.d.Bt2A2mmi.js';
|
|
16
16
|
import { Debugger } from 'obug';
|
|
17
|
-
export { g as generateFileHash } from './chunks/task-utils.d.
|
|
17
|
+
export { g as generateFileHash } from './chunks/task-utils.d.C-IeGxLU.js';
|
|
18
18
|
export { CDPSession } from 'vitest/browser';
|
|
19
|
-
import './chunks/browser.d.
|
|
19
|
+
import './chunks/browser.d.3cffPS1V.js';
|
|
20
20
|
import 'chai';
|
|
21
21
|
import 'vitest/optional-types.js';
|
|
22
22
|
import '@vitest/mocker';
|
|
23
|
-
import './chunks/source-map.d.
|
|
23
|
+
import './chunks/source-map.d.BLHtC2OB.js';
|
|
24
24
|
import 'node:path';
|
|
25
25
|
import 'node:console';
|
|
26
26
|
import 'node:fs/promises';
|
|
@@ -28,7 +28,7 @@ import 'node:fs';
|
|
|
28
28
|
import 'vitest/optional-runtime-types.js';
|
|
29
29
|
import 'tinybench';
|
|
30
30
|
import 'vite/module-runner';
|
|
31
|
-
import './chunks/environment.d.
|
|
31
|
+
import './chunks/environment.d.DAj1Vt__.js';
|
|
32
32
|
|
|
33
33
|
declare function escapeTestName(label: string, dynamic: boolean): string;
|
|
34
34
|
|
package/dist/node.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
-
import { V as Vitest } from './chunks/index.
|
|
4
|
-
export { M as AgentReporter, B as BaseCoverageProvider, a as BaseSequencer, b as BrowserConnectionError, D as DefaultReporter, c as DotReporter, F as ForksPoolWorker, G as GitNotFoundError, d as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, e as JsonReporter, L as Logger, M as MinimalReporter, P as PluginHarness, R as ReportersMap, T as TapFlatReporter, f as TapReporter, g as TestsNotFoundError, h as ThreadsPoolWorker, i as TypecheckPoolWorker, j as VerboseReporter, k as VitestPackageInstaller, l as VmForksPoolWorker, m as VmThreadsPoolWorker, n as createDebugger, o as createMethodsRPC, p as createViteLogger, q as escapeTestName, r as experimental_getRunnerTask, s as getFilePoolName, t as isFileServingAllowed, u as isValidApiRequest, v as resolveApiServerConfig, w as resolveConfig, x as resolveFsAllow } from './chunks/index.
|
|
5
|
-
export { c as createCLI, p as parseCLI } from './chunks/cac.
|
|
6
|
-
export { c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.
|
|
3
|
+
import { V as Vitest } from './chunks/index.DpLw24bj.js';
|
|
4
|
+
export { M as AgentReporter, B as BaseCoverageProvider, a as BaseSequencer, b as BrowserConnectionError, D as DefaultReporter, c as DotReporter, F as ForksPoolWorker, G as GitNotFoundError, d as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, e as JsonReporter, L as Logger, M as MinimalReporter, P as PluginHarness, R as ReportersMap, T as TapFlatReporter, f as TapReporter, g as TestsNotFoundError, h as ThreadsPoolWorker, i as TypecheckPoolWorker, j as VerboseReporter, k as VitestPackageInstaller, l as VmForksPoolWorker, m as VmThreadsPoolWorker, n as createDebugger, o as createMethodsRPC, p as createViteLogger, q as escapeTestName, r as experimental_getRunnerTask, s as getFilePoolName, t as isFileServingAllowed, u as isValidApiRequest, v as resolveApiServerConfig, w as resolveConfig, x as resolveFsAllow } from './chunks/index.DpLw24bj.js';
|
|
5
|
+
export { c as createCLI, p as parseCLI } from './chunks/cac.DfDGTQ9W.js';
|
|
6
|
+
export { c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.C4x4GGip.js';
|
|
7
7
|
export { distDir, rootDir } from './path.js';
|
|
8
8
|
export { generateFileHash } from './task-utils.js';
|
|
9
9
|
export { m as disableDefaultColors } from './chunks/tinyrainbow.Ht9iggcq.js';
|
|
10
|
+
import 'node:fs/promises';
|
|
10
11
|
import 'node:os';
|
|
11
|
-
import './chunks/pathe.M-eThtNZ.
|
|
12
|
-
import './chunks/source-map.
|
|
12
|
+
import './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
13
|
+
import './chunks/source-map.DUxvo12T.js';
|
|
14
|
+
import './chunks/index.cx-_w29y.js';
|
|
13
15
|
import 'node:fs';
|
|
14
16
|
import 'node:perf_hooks';
|
|
15
17
|
import './chunks/index.DmDMHCg8.js';
|
|
@@ -26,22 +28,20 @@ import 'buffer';
|
|
|
26
28
|
import 'util';
|
|
27
29
|
import './chunks/constants.-juJ8b_4.js';
|
|
28
30
|
import 'node:crypto';
|
|
29
|
-
import './chunks/run.
|
|
30
|
-
import './chunks/
|
|
31
|
-
import './chunks/
|
|
32
|
-
import './chunks/nativeModuleRunner.J0QLzNtK.js';
|
|
31
|
+
import './chunks/run.BTlFXlnv.js';
|
|
32
|
+
import './chunks/display.CXBnkt9a.js';
|
|
33
|
+
import './chunks/nativeModuleRunner.jwZPY3dg.js';
|
|
33
34
|
import 'node:url';
|
|
34
35
|
import 'node:module';
|
|
35
36
|
import 'node:path';
|
|
36
37
|
import 'node:process';
|
|
37
|
-
import 'node:fs/promises';
|
|
38
38
|
import 'node:assert';
|
|
39
39
|
import 'node:v8';
|
|
40
40
|
import 'node:util';
|
|
41
41
|
import 'vite/module-runner';
|
|
42
42
|
import './traces.js';
|
|
43
43
|
import 'obug';
|
|
44
|
-
import './chunks/resolver.
|
|
44
|
+
import './chunks/resolver.fbW9AUvG.js';
|
|
45
45
|
import 'es-module-lexer';
|
|
46
46
|
import './chunks/env.DzFJjrmK.js';
|
|
47
47
|
import 'std-env';
|
|
@@ -53,10 +53,10 @@ import 'node:console';
|
|
|
53
53
|
import 'node:stream';
|
|
54
54
|
import 'tinyexec';
|
|
55
55
|
import './chunks/offset.Dy-5Fdfn.js';
|
|
56
|
-
import './chunks/utils.
|
|
56
|
+
import './chunks/utils.RcGwuOc_.js';
|
|
57
57
|
import '#module-evaluator';
|
|
58
58
|
import 'picomatch';
|
|
59
|
-
import './chunks/coverage.
|
|
59
|
+
import './chunks/coverage._yXj5zeb.js';
|
|
60
60
|
import 'node:tty';
|
|
61
61
|
import 'node:events';
|
|
62
62
|
import './chunks/modules.BJuCwlRJ.js';
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { E as Environment } from './chunks/environment.d.
|
|
2
|
-
export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.
|
|
3
|
-
import { br as SnapshotEnvironment, bs as SnapshotEnvironmentOptions } from './chunks/config.d.
|
|
4
|
-
export { b as SerializedConfig, V as VitestRunner } from './chunks/config.d.
|
|
1
|
+
import { E as Environment } from './chunks/environment.d.DAj1Vt__.js';
|
|
2
|
+
export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.DAj1Vt__.js';
|
|
3
|
+
import { br as SnapshotEnvironment, bs as SnapshotEnvironmentOptions } from './chunks/config.d.BxjInJat.js';
|
|
4
|
+
export { b as SerializedConfig, V as VitestRunner } from './chunks/config.d.BxjInJat.js';
|
|
5
5
|
import 'vitest/optional-runtime-types.js';
|
|
6
6
|
import 'tinybench';
|
|
7
7
|
|
|
8
8
|
declare const environments: {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
node: Environment;
|
|
10
|
+
jsdom: Environment;
|
|
11
11
|
"happy-dom": Environment;
|
|
12
12
|
"edge-runtime": Environment;
|
|
13
13
|
};
|
package/dist/runtime.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { VitestModuleEvaluator } from './module-evaluator.js';
|
|
2
|
-
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/index.
|
|
3
|
-
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.
|
|
2
|
+
import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/index.k8L_ZRzq.js';
|
|
3
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.k8L_ZRzq.js';
|
|
4
4
|
import { g as getWorkerState } from './chunks/utils.DYj33du9.js';
|
|
5
|
-
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.
|
|
5
|
+
export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.BzimPqT5.js';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:url';
|
|
8
8
|
import 'node:vm';
|
|
9
9
|
import 'vite/module-runner';
|
|
10
10
|
import './traces.js';
|
|
11
11
|
import 'node:fs';
|
|
12
|
-
import './chunks/pathe.M-eThtNZ.
|
|
12
|
+
import './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
13
13
|
import './chunks/modules.BJuCwlRJ.js';
|
|
14
14
|
import './path.js';
|
|
15
15
|
import 'node:path';
|
package/dist/spy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as clearAllMocks, d as createMockInstance, f as fn, i as isMockFunction, b as resetAllMocks, r as restoreAllMocks, a as spyOn } from './chunks/spy.
|
|
1
|
+
export { c as clearAllMocks, d as createMockInstance, f as fn, i as isMockFunction, b as resetAllMocks, r as restoreAllMocks, a as spyOn } from './chunks/spy.DgMTfhrK.js';
|
package/dist/task-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as toArray, a as relative } from './chunks/pathe.M-eThtNZ.
|
|
1
|
+
import { t as toArray, a as relative } from './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
2
2
|
|
|
3
3
|
/* @__NO_SIDE_EFFECTS__ */
|
|
4
4
|
function isTestCase(s) {
|
|
@@ -220,6 +220,7 @@ function interpretTaskModes(file, namePattern, testLocations, testIds, testTagsF
|
|
|
220
220
|
else if (t.type === "test") t.mode = "skip";
|
|
221
221
|
}
|
|
222
222
|
if (t.type === "test") {
|
|
223
|
+
// oxlint-disable-next-line unicorn/prefer-regexp-test -- namePattern can be a string
|
|
223
224
|
if (namePattern && !t.fullTestName.match(namePattern)) t.mode = "skip";
|
|
224
225
|
if (testIdsSet && !testIdsSet.has(t.id)) t.mode = "skip";
|
|
225
226
|
if (testTagsFilter && !testTagsFilter(t.tags || [])) t.mode = "skip";
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as WorkerSetupContext, e as BirpcOptions } from './chunks/worker.d.
|
|
1
|
+
import { d as WorkerSetupContext, e as BirpcOptions } from './chunks/worker.d.Bt2A2mmi.js';
|
|
2
2
|
import { WorkerGlobalState } from './index.js';
|
|
3
|
-
import { T as Traces } from './chunks/rpc.d.
|
|
3
|
+
import { T as Traces } from './chunks/rpc.d.BPFHl-HE.js';
|
|
4
4
|
import { RuntimeRPC } from './index.js';
|
|
5
|
-
import { A as Awaitable } from './chunks/config.d.
|
|
5
|
+
import { A as Awaitable } from './chunks/config.d.BxjInJat.js';
|
|
6
6
|
import { ModuleRunner } from 'vite/module-runner';
|
|
7
|
-
import './chunks/environment.d.
|
|
7
|
+
import './chunks/environment.d.DAj1Vt__.js';
|
|
8
8
|
import 'vitest/optional-runtime-types.js';
|
|
9
9
|
import 'tinybench';
|
|
10
10
|
|
package/dist/worker.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export { r as runBaseTests, s as setupEnvironment } from './chunks/base.
|
|
2
|
-
export { i as init } from './chunks/init.
|
|
1
|
+
export { r as runBaseTests, s as setupEnvironment } from './chunks/base.DhkQeZwd.js';
|
|
2
|
+
export { i as init } from './chunks/init.D0qF-GGk.js';
|
|
3
3
|
import 'node:vm';
|
|
4
|
-
import './chunks/spy.
|
|
5
|
-
import './chunks/index.
|
|
4
|
+
import './chunks/spy.DgMTfhrK.js';
|
|
5
|
+
import './chunks/index.ggMXe2IF.js';
|
|
6
6
|
import 'chai';
|
|
7
7
|
import 'node:async_hooks';
|
|
8
|
-
import './chunks/coverage.
|
|
9
|
-
import './chunks/coverage.
|
|
10
|
-
import './chunks/pathe.M-eThtNZ.
|
|
11
|
-
import './chunks/rpc.
|
|
8
|
+
import './chunks/coverage.S6Dao4g-.js';
|
|
9
|
+
import './chunks/coverage._yXj5zeb.js';
|
|
10
|
+
import './chunks/pathe.M-eThtNZ.CknpM8Or.js';
|
|
11
|
+
import './chunks/rpc.BTmCtPly.js';
|
|
12
12
|
import 'vite/module-runner';
|
|
13
|
-
import './chunks/source-map.
|
|
13
|
+
import './chunks/source-map.DUxvo12T.js';
|
|
14
|
+
import './chunks/index.cx-_w29y.js';
|
|
15
|
+
import './chunks/tinyrainbow.Ht9iggcq.js';
|
|
14
16
|
import './chunks/index.DmDMHCg8.js';
|
|
15
17
|
import './chunks/utils.DYj33du9.js';
|
|
16
|
-
import './chunks/setup-common.
|
|
17
|
-
import './chunks/plugins.
|
|
18
|
-
import './chunks/index.
|
|
19
|
-
import './chunks/
|
|
20
|
-
import './chunks/
|
|
21
|
-
import './chunks/run.C5UmxDPh.js';
|
|
22
|
-
import './chunks/display.pkpxlVcY.js';
|
|
18
|
+
import './chunks/setup-common.BglbuAHD.js';
|
|
19
|
+
import './chunks/plugins.D2ut1V9b.js';
|
|
20
|
+
import './chunks/index.C4tKZ0yW.js';
|
|
21
|
+
import './chunks/run.BTlFXlnv.js';
|
|
22
|
+
import './chunks/display.CXBnkt9a.js';
|
|
23
23
|
import './task-utils.js';
|
|
24
24
|
import './chunks/offset.Dy-5Fdfn.js';
|
|
25
25
|
import 'tinybench';
|
|
26
26
|
import 'expect-type';
|
|
27
27
|
import './traces.js';
|
|
28
|
-
import './chunks/index.
|
|
28
|
+
import './chunks/index.k8L_ZRzq.js';
|
|
29
29
|
import 'node:fs';
|
|
30
30
|
import './chunks/modules.BJuCwlRJ.js';
|
|
31
31
|
import 'node:module';
|