vitest 5.0.0-beta.2 → 5.0.0-beta.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/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.Opc_YHkk.js → base.Bay6B1Dz.js} +4 -4
- package/dist/chunks/{browser.d.BUhkKcDl.d.ts → browser.d.DM1g8UNp.d.ts} +2 -2
- package/dist/chunks/{cac.8N4bOkkB.js → cac.DoK9yX-i.js} +8 -6
- package/dist/chunks/{cli-api.B0RFke2g.js → cli-api.BCY9ylNq.js} +140 -68
- package/dist/chunks/{config.d.D91DHYaD.d.ts → config.d.C0UMwus7.d.ts} +86 -63
- package/dist/chunks/{defaults.szbHWQun.js → defaults.DVfzlTkU.js} +1 -1
- package/dist/chunks/{env.D4Lgay0q.js → env.BKKtU2WC.js} +2 -1
- package/dist/chunks/{global.d.DhbKSQoV.d.ts → global.d.DZbA5YnY.d.ts} +4 -2
- package/dist/chunks/{globals.EHmmu0nC.js → globals.8_qjZdeE.js} +1 -1
- package/dist/chunks/{index.CViWo__T.js → index.PuMGMNHF.js} +2 -2
- package/dist/chunks/{index.D_7-4CaB.js → index.ukHtlBbI.js} +1305 -555
- package/dist/chunks/{init-forks.DMge3WTt.js → init-forks.OoZmDo1g.js} +1 -1
- package/dist/chunks/{init-threads.eIoyCTon.js → init-threads.eSHAowcx.js} +1 -1
- package/dist/chunks/{init.BVd7SaCA.js → init.YjNsCb-_.js} +1 -1
- package/dist/chunks/{plugin.d.cIKZEZ16.d.ts → plugin.d.C00LxKL6.d.ts} +35 -9
- package/dist/chunks/{setup-common.Hpq30zVk.js → setup-common.eQsbxe88.js} +1 -1
- package/dist/chunks/{vm.2okbRRME.js → vm.BE_VOfSs.js} +1 -1
- package/dist/chunks/{worker.d.Bu1kXGw4.d.ts → worker.d.Dv3hDCFf.d.ts} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +6 -7
- package/dist/config.js +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/module-evaluator.js +1 -1
- package/dist/node.d.ts +7 -8
- package/dist/node.js +5 -5
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +5 -5
- package/dist/workers/forks.js +6 -6
- package/dist/workers/runVmTests.js +3 -3
- package/dist/workers/threads.js +6 -6
- package/dist/workers/vmForks.js +3 -3
- package/dist/workers/vmThreads.js +3 -3
- package/package.json +19 -20
|
@@ -4,66 +4,88 @@ import { L as LabelColor, g as SnapshotUpdateState } from './general.d.DFAHgpC2.
|
|
|
4
4
|
import { S as SnapshotEnvironment } from './environment.d-DOJxxZV9.d.DOJxxZV9.js';
|
|
5
5
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
7
|
+
type VoidVarArgsFunc = (...args: unknown[]) => void;
|
|
8
|
+
type SetImmediate = (callback: VoidVarArgsFunc, ...args: unknown[]) => NodeImmediate;
|
|
9
|
+
type SetTimeout = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
10
|
+
type ClearTimeout = (id?: TimerId) => void;
|
|
11
|
+
type SetInterval = (callback: VoidVarArgsFunc, delay?: number, ...args: unknown[]) => TimerId;
|
|
12
|
+
type ClearInterval = (id?: TimerId) => void;
|
|
13
|
+
type QueueMicrotask = (callback: VoidVarArgsFunc) => void;
|
|
14
|
+
type TimeRemaining = () => number;
|
|
15
|
+
type IdleDeadline = {
|
|
16
|
+
didTimeout: boolean;
|
|
17
|
+
timeRemaining: TimeRemaining;
|
|
18
|
+
};
|
|
19
|
+
type RequestIdleCallbackCallback = (deadline: IdleDeadline) => any;
|
|
20
|
+
type RequestIdleCallback = (callback: RequestIdleCallbackCallback, options?: {
|
|
21
|
+
timeout?: number;
|
|
22
|
+
}) => number;
|
|
23
|
+
type AnimationFrameCallback = (timestamp: number) => any;
|
|
24
|
+
type RequestAnimationFrame = (callback: AnimationFrameCallback) => TimerId;
|
|
25
|
+
type CancelAnimationFrame = (id: TimerId) => void;
|
|
26
|
+
type CancelIdleCallback = (id: TimerId) => void;
|
|
27
|
+
type ClearImmediate = (id: NodeImmediate) => void;
|
|
28
|
+
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime" | "requestAnimationFrame" | "cancelAnimationFrame" | "requestIdleCallback" | "cancelIdleCallback" | "performance" | "queueMicrotask";
|
|
29
|
+
type TimerId = number | NodeImmediate | Timer;
|
|
30
|
+
type GlobalObject = Record<string, any> & {
|
|
31
|
+
setTimeout?: SetTimeout;
|
|
32
|
+
clearTimeout?: ClearTimeout;
|
|
33
|
+
setInterval?: SetInterval;
|
|
34
|
+
clearInterval?: ClearInterval;
|
|
35
|
+
setImmediate?: SetImmediate;
|
|
36
|
+
clearImmediate?: ClearImmediate;
|
|
37
|
+
queueMicrotask?: QueueMicrotask;
|
|
38
|
+
requestAnimationFrame?: RequestAnimationFrame;
|
|
39
|
+
cancelAnimationFrame?: CancelAnimationFrame;
|
|
40
|
+
requestIdleCallback?: RequestIdleCallback;
|
|
41
|
+
cancelIdleCallback?: CancelIdleCallback;
|
|
42
|
+
process?: any;
|
|
43
|
+
performance?: any;
|
|
44
|
+
Performance?: any;
|
|
45
|
+
Intl?: any;
|
|
46
|
+
Promise?: typeof Promise;
|
|
47
|
+
Date: typeof Date & {
|
|
48
|
+
isFake?: boolean;
|
|
49
|
+
toSource?: () => string;
|
|
50
|
+
clock?: any;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type TimerInitialProps = {
|
|
54
|
+
func: VoidVarArgsFunc;
|
|
55
|
+
args?: unknown[];
|
|
56
|
+
type?: 'Timeout' | 'Interval' | 'Immediate' | 'AnimationFrame' | 'IdleCallback';
|
|
57
|
+
delay?: number;
|
|
58
|
+
callAt?: number;
|
|
59
|
+
createdAt?: number;
|
|
60
|
+
immediate?: boolean;
|
|
61
|
+
id?: number;
|
|
62
|
+
error?: Error;
|
|
63
|
+
interval?: number;
|
|
64
|
+
animation?: boolean;
|
|
65
|
+
requestIdleCallback?: boolean;
|
|
66
|
+
order?: number;
|
|
67
|
+
heapIndex?: number;
|
|
68
|
+
};
|
|
69
|
+
type Config = {
|
|
70
|
+
now?: number | Date;
|
|
71
|
+
toFake?: FakeMethod[];
|
|
72
|
+
toNotFake?: FakeMethod[];
|
|
73
|
+
loopLimit?: number;
|
|
74
|
+
shouldAdvanceTime?: boolean;
|
|
75
|
+
advanceTimeDelta?: number;
|
|
76
|
+
shouldClearNativeTimers?: boolean;
|
|
77
|
+
ignoreMissingTimers?: boolean;
|
|
78
|
+
target?: GlobalObject;
|
|
79
|
+
};
|
|
80
|
+
type Timer = TimerInitialProps;
|
|
81
|
+
type NodeImmediateHasRef = () => boolean;
|
|
82
|
+
type NodeImmediateRef = () => NodeImmediate;
|
|
83
|
+
type NodeImmediateUnref = () => NodeImmediate;
|
|
84
|
+
type NodeImmediate = {
|
|
85
|
+
hasRef: NodeImmediateHasRef;
|
|
86
|
+
ref: NodeImmediateRef;
|
|
87
|
+
unref: NodeImmediateUnref;
|
|
88
|
+
};
|
|
67
89
|
|
|
68
90
|
/**
|
|
69
91
|
* Config that tests have access to.
|
|
@@ -93,7 +115,7 @@ interface SerializedConfig {
|
|
|
93
115
|
restoreMocks: boolean;
|
|
94
116
|
unstubGlobals: boolean;
|
|
95
117
|
unstubEnvs: boolean;
|
|
96
|
-
fakeTimers:
|
|
118
|
+
fakeTimers: Config;
|
|
97
119
|
maxConcurrency: number;
|
|
98
120
|
defines: Record<string, any>;
|
|
99
121
|
expect: {
|
|
@@ -170,6 +192,7 @@ interface SerializedConfig {
|
|
|
170
192
|
locators: {
|
|
171
193
|
testIdAttribute: string;
|
|
172
194
|
exact: boolean;
|
|
195
|
+
errorFormat: "html" | "aria" | "all";
|
|
173
196
|
};
|
|
174
197
|
screenshotFailures: boolean;
|
|
175
198
|
providerOptions: {
|
|
@@ -216,7 +239,7 @@ interface SerializedConfig {
|
|
|
216
239
|
strictTags: boolean;
|
|
217
240
|
mergeReportsLabel: string | undefined;
|
|
218
241
|
slowTestThreshold: number | undefined;
|
|
219
|
-
|
|
242
|
+
disableColors: boolean;
|
|
220
243
|
}
|
|
221
244
|
interface SerializedCoverageConfig {
|
|
222
245
|
provider: "istanbul" | "v8" | "custom" | undefined;
|
|
@@ -237,4 +260,4 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
|
|
|
237
260
|
type RuntimeOptions = Partial<RuntimeConfig>;
|
|
238
261
|
type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
|
|
239
262
|
|
|
240
|
-
export type { BrowserTraceViewMode as B,
|
|
263
|
+
export type { BrowserTraceViewMode as B, Config as C, RuntimeOptions as R, SerializedRootConfig as S, SerializedConfig as a, RuntimeConfig as b, SerializedCoverageConfig as c };
|
|
@@ -4,5 +4,6 @@ const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.v
|
|
|
4
4
|
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
|
|
5
5
|
const isWindows = (isNode || isDeno) && process.platform === "win32";
|
|
6
6
|
const isTTY = (isNode || isDeno) && process.stdout?.isTTY && !isCI;
|
|
7
|
+
const isForceColor = () => "FORCE_COLOR" in process.env;
|
|
7
8
|
|
|
8
|
-
export {
|
|
9
|
+
export { isTTY as a, isWindows as b, isForceColor as i };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PromisifyAssertion, T as Tester, E as ExpectStatic, l as BenchmarkResult } from './browser.d.
|
|
1
|
+
import { P as PromisifyAssertion, T as Tester, E as ExpectStatic, l as BenchmarkResult } from './browser.d.DM1g8UNp.js';
|
|
2
2
|
import { Plugin } from '@vitest/pretty-format';
|
|
3
3
|
import { Test } from '@vitest/runner';
|
|
4
4
|
import { i as SnapshotState, U as UserConsoleLog } from './general.d.DFAHgpC2.js';
|
|
@@ -26,7 +26,9 @@ declare module "vitest" {
|
|
|
26
26
|
assert: Chai.AssertStatic;
|
|
27
27
|
unreachable: (message?: string) => never;
|
|
28
28
|
soft: <T>(actual: T, message?: string) => Assertion<T>;
|
|
29
|
-
poll: <T>(actual: (
|
|
29
|
+
poll: <T>(actual: (options: {
|
|
30
|
+
signal: AbortSignal;
|
|
31
|
+
}) => T, options?: ExpectPollOptions) => PromisifyAssertion<Awaited<T>>;
|
|
30
32
|
addEqualityTesters: (testers: Array<Tester>) => void;
|
|
31
33
|
assertions: (expected: number) => void;
|
|
32
34
|
hasAssertions: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as chai from 'chai';
|
|
2
2
|
import { createHook } from 'node:async_hooks';
|
|
3
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.
|
|
3
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.eQsbxe88.js';
|
|
4
4
|
import { r as rpc } from './rpc.DFRWVnRh.js';
|
|
5
5
|
import { g as getWorkerState } from './utils.BX5Fg8C4.js';
|
|
6
|
-
import { T as TestRunner, N as NodeBenchmarkRunner } from './index.
|
|
6
|
+
import { T as TestRunner, N as NodeBenchmarkRunner } from './index.ukHtlBbI.js';
|
|
7
7
|
|
|
8
8
|
function setupChaiConfig(config) {
|
|
9
9
|
Object.assign(chai.config, config);
|