vitest 4.0.17 → 4.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +36 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +2 -2
- package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
- package/dist/chunks/{base.XJJQZiKB.js → base.DiopZV8F.js} +49 -14
- package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.BoqSLF53.js} +1 -1
- package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.BE4kbYok.d.ts} +4 -1
- package/dist/chunks/{cac.jRCLJDDc.js → cac.C4jjt2RX.js} +816 -14
- package/dist/chunks/{cli-api.Cx2DW4Bc.js → cli-api.ChbI1JU9.js} +412 -166
- package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.Cr1Ep39N.d.ts} +13 -11
- package/dist/chunks/{console.Cf-YriPC.js → console.CNlG1KsP.js} +3 -2
- package/dist/chunks/{constants.D_Q9UYh-.js → constants.B63TT-Bl.js} +1 -1
- package/dist/chunks/coverage.tyqbzn4W.js +1001 -0
- package/dist/chunks/{creator.DAmOKTvJ.js → creator.yyCHuw5R.js} +33 -2
- package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.JeWMqlOm.d.ts} +1 -1
- package/dist/chunks/{globals.DOayXfHP.js → globals.C6Ecf1TO.js} +11 -10
- package/dist/chunks/{index.M8mOzt4Y.js → index.B-iBE_Gx.js} +21 -5
- package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
- package/dist/chunks/{index.6Qv1eEA6.js → index.CAN630q3.js} +20 -8
- package/dist/chunks/{index.C5r1PdPD.js → index.CFulQRmC.js} +1 -1
- package/dist/chunks/{index.Z5E_ObnR.js → index.CouFDptX.js} +4 -2
- package/dist/chunks/{init-forks.BC6ZwHQN.js → init-forks.BnCXPazU.js} +1 -1
- package/dist/chunks/{init-threads.CxSxLC0N.js → init-threads.Cyh2PqXi.js} +1 -1
- package/dist/chunks/{init.C9kljSTm.js → init.B95Mm0Iz.js} +65 -12
- package/dist/chunks/native.mV0-490A.js +148 -0
- package/dist/chunks/nativeModuleMocker.D_q5sFv6.js +206 -0
- package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
- package/dist/chunks/{node.Ce0vMQM7.js → node.CrSEwhm4.js} +1 -1
- package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.C9o5bttz.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.7faYdkxy.d.ts} +146 -49
- package/dist/chunks/rpc.DcRWTy5G.js +148 -0
- package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.CM7x9-sm.d.ts} +1 -0
- package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.cvFp-ao9.js} +2 -2
- package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.BK-u7y4N.js} +182 -391
- package/dist/chunks/{vi.2VT5v0um.js → test.G82XYNFk.js} +505 -119
- package/dist/chunks/{utils.DvEY5TfP.js → utils.DT4VyRyl.js} +5 -1
- package/dist/chunks/{vm.CMjifoPa.js → vm.BdLtzhnj.js} +15 -11
- package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.CPzI2ZzJ.d.ts} +2 -2
- package/dist/cli.js +4 -3
- package/dist/config.d.ts +11 -11
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +10 -8
- package/dist/coverage.js +7 -4
- package/dist/environments.js +2 -0
- package/dist/index.d.ts +30 -23
- package/dist/index.js +9 -8
- package/dist/module-evaluator.d.ts +10 -1
- package/dist/module-evaluator.js +1 -5
- package/dist/node.d.ts +13 -12
- package/dist/node.js +27 -25
- package/dist/nodejs-worker-loader.js +41 -0
- package/dist/reporters.d.ts +8 -8
- package/dist/reporters.js +4 -2
- package/dist/runners.d.ts +24 -4
- package/dist/runners.js +6 -6
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.js +35 -0
- package/dist/snapshot.js +4 -2
- package/dist/suite.js +4 -2
- package/dist/worker.d.ts +8 -7
- package/dist/worker.js +25 -20
- package/dist/workers/forks.js +21 -16
- package/dist/workers/runVmTests.js +11 -13
- package/dist/workers/threads.js +21 -16
- package/dist/workers/vmForks.js +14 -11
- package/dist/workers/vmThreads.js +14 -11
- package/package.json +28 -29
- package/suppress-warnings.cjs +1 -0
- package/dist/chunks/date.Bq6ZW5rf.js +0 -73
- package/dist/chunks/rpc.BoxB0q7B.js +0 -76
- package/dist/chunks/test.B8ej_ZHS.js +0 -254
- package/dist/mocker.d.ts +0 -1
- package/dist/mocker.js +0 -1
- package/dist/module-runner.js +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrettyFormatOptions } from '@vitest/pretty-format';
|
|
2
|
-
import { SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
2
|
+
import { SequenceHooks, SequenceSetupFiles, SerializableRetry, TestTagDefinition } from '@vitest/runner';
|
|
3
3
|
import { SnapshotUpdateState, SnapshotEnvironment } from '@vitest/snapshot';
|
|
4
4
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
5
5
|
|
|
@@ -30,15 +30,13 @@ interface FakeTimerInstallOpts {
|
|
|
30
30
|
now?: number | Date | undefined;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* An array with names of global methods and APIs to fake.
|
|
34
|
-
* For instance, `
|
|
35
|
-
* @default everything available globally except `nextTick`
|
|
33
|
+
* An array with names of global methods and APIs to fake. By default, `@sinonjs/fake-timers` does not replace `nextTick()` and `queueMicrotask()`.
|
|
34
|
+
* For instance, `FakeTimers.install({ toFake: ['setTimeout', 'nextTick'] })` will fake only `setTimeout()` and `nextTick()`
|
|
36
35
|
*/
|
|
37
36
|
toFake?: FakeMethod[] | undefined;
|
|
38
37
|
|
|
39
38
|
/**
|
|
40
|
-
* The maximum number of timers that will be run when calling runAll()
|
|
41
|
-
* @default 10000
|
|
39
|
+
* The maximum number of timers that will be run when calling runAll() (default: 1000)
|
|
42
40
|
*/
|
|
43
41
|
loopLimit?: number | undefined;
|
|
44
42
|
|
|
@@ -55,14 +53,13 @@ interface FakeTimerInstallOpts {
|
|
|
55
53
|
advanceTimeDelta?: number | undefined;
|
|
56
54
|
|
|
57
55
|
/**
|
|
58
|
-
* Tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers.
|
|
59
|
-
*
|
|
56
|
+
* Tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by
|
|
57
|
+
* default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. (default: false)
|
|
60
58
|
*/
|
|
61
59
|
shouldClearNativeTimers?: boolean | undefined;
|
|
62
60
|
|
|
63
61
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @default false
|
|
62
|
+
* Tells FakeTimers to not throw an error when faking a timer that does not exist in the global object. (default: false)
|
|
66
63
|
*/
|
|
67
64
|
ignoreMissingTimers?: boolean | undefined;
|
|
68
65
|
}
|
|
@@ -141,7 +138,7 @@ interface SerializedConfig {
|
|
|
141
138
|
truncateThreshold?: number;
|
|
142
139
|
} | undefined;
|
|
143
140
|
diff: string | SerializedDiffOptions | undefined;
|
|
144
|
-
retry:
|
|
141
|
+
retry: SerializableRetry;
|
|
145
142
|
includeTaskLocation: boolean | undefined;
|
|
146
143
|
inspect: boolean | string | undefined;
|
|
147
144
|
inspectBrk: boolean | string | undefined;
|
|
@@ -183,12 +180,17 @@ interface SerializedConfig {
|
|
|
183
180
|
experimental: {
|
|
184
181
|
fsModuleCache: boolean;
|
|
185
182
|
printImportBreakdown: boolean | undefined;
|
|
183
|
+
viteModuleRunner: boolean;
|
|
184
|
+
nodeLoader: boolean;
|
|
186
185
|
openTelemetry: {
|
|
187
186
|
enabled: boolean;
|
|
188
187
|
sdkPath?: string;
|
|
189
188
|
browserSdkPath?: string;
|
|
190
189
|
} | undefined;
|
|
191
190
|
};
|
|
191
|
+
tags: TestTagDefinition[];
|
|
192
|
+
tagsFilter: string[] | undefined;
|
|
193
|
+
strictTags: boolean;
|
|
192
194
|
}
|
|
193
195
|
interface SerializedCoverageConfig {
|
|
194
196
|
provider: "istanbul" | "v8" | "custom" | undefined;
|
|
@@ -3,8 +3,9 @@ import { relative } from 'node:path';
|
|
|
3
3
|
import { Writable } from 'node:stream';
|
|
4
4
|
import { getSafeTimers } from '@vitest/utils/timers';
|
|
5
5
|
import c from 'tinyrainbow';
|
|
6
|
-
import { R as RealDate } from './
|
|
7
|
-
import { g as getWorkerState } from './utils.
|
|
6
|
+
import { R as RealDate } from './rpc.DcRWTy5G.js';
|
|
7
|
+
import { g as getWorkerState } from './utils.DT4VyRyl.js';
|
|
8
|
+
import './index.Chj8NDwU.js';
|
|
8
9
|
|
|
9
10
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
10
11
|
function getTaskIdByStack(root) {
|
|
@@ -33,4 +33,4 @@ const globalApis = [
|
|
|
33
33
|
"onTestFailed"
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
-
export { API_PATH as A,
|
|
36
|
+
export { API_PATH as A, defaultInspectPort as a, defaultPort as b, configFiles as c, defaultBrowserPort as d, globalApis as g };
|