vitest 5.0.0-beta.3 → 5.0.0-beta.4

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.
Files changed (43) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{base.Bay6B1Dz.js → base.BEGVMQrS.js} +6 -6
  4. package/dist/chunks/{browser.d.DM1g8UNp.d.ts → browser.d.BGxB4Xum.d.ts} +4 -25
  5. package/dist/chunks/{cac.DoK9yX-i.js → cac.CyXAEMkE.js} +22 -31
  6. package/dist/chunks/{cli-api.BCY9ylNq.js → cli-api.DJMXq34b.js} +502 -549
  7. package/dist/chunks/{config.d.C0UMwus7.d.ts → config.d.DXq1aBpy.d.ts} +7 -26
  8. package/dist/chunks/{creator.BqL2U_x4.js → creator.D66cVXYh.js} +2 -2
  9. package/dist/chunks/{defaults.DVfzlTkU.js → defaults.CUUnbOrq.js} +5 -3
  10. package/dist/chunks/global.d.BtKPuz2X.d.ts +194 -0
  11. package/dist/chunks/{globals.8_qjZdeE.js → globals.BuY-yD0m.js} +2 -1
  12. package/dist/chunks/{index.ukHtlBbI.js → index.CE58PZNH.js} +355 -146
  13. package/dist/chunks/{index.PuMGMNHF.js → index.CcluKS59.js} +4 -4
  14. package/dist/chunks/{index.CbgUM9E5.js → index.nQFVd50u.js} +2 -1
  15. package/dist/chunks/{init-forks.OoZmDo1g.js → init-forks.Ce3vGWgL.js} +1 -1
  16. package/dist/chunks/{init-threads.eSHAowcx.js → init-threads.8e1OLv5v.js} +1 -1
  17. package/dist/chunks/{init.YjNsCb-_.js → init.6qx-LaHs.js} +30 -2
  18. package/dist/chunks/{nativeModuleMocker.DKpFw0pk.js → nativeModuleMocker.DDZfQXLs.js} +1 -1
  19. package/dist/chunks/{plugin.d.C00LxKL6.d.ts → plugin.d.B7MTG_Fe.d.ts} +71 -82
  20. package/dist/chunks/{rpc.d.7JZuxZ8u.d.ts → rpc.d.OQ_EZi1Z.d.ts} +18 -2
  21. package/dist/chunks/{setup-common.eQsbxe88.js → setup-common.DdEF_hkE.js} +1 -1
  22. package/dist/chunks/{vm.BE_VOfSs.js → vm.Bu7mmcZq.js} +2 -2
  23. package/dist/chunks/{worker.d.Dv3hDCFf.d.ts → worker.d.yR22cs6X.d.ts} +3 -2
  24. package/dist/cli.js +1 -1
  25. package/dist/config.cjs +1 -1
  26. package/dist/config.d.ts +6 -8
  27. package/dist/config.js +1 -1
  28. package/dist/index.d.ts +23 -40
  29. package/dist/index.js +2 -1
  30. package/dist/module-evaluator.d.ts +4 -1
  31. package/dist/module-evaluator.js +14 -19
  32. package/dist/node.d.ts +20 -12
  33. package/dist/node.js +5 -5
  34. package/dist/runtime.js +2 -2
  35. package/dist/worker.d.ts +3 -3
  36. package/dist/worker.js +7 -6
  37. package/dist/workers/forks.js +8 -7
  38. package/dist/workers/runVmTests.js +4 -3
  39. package/dist/workers/threads.js +8 -7
  40. package/dist/workers/vmForks.js +4 -4
  41. package/dist/workers/vmThreads.js +4 -4
  42. package/package.json +15 -15
  43. package/dist/chunks/global.d.DZbA5YnY.d.ts +0 -101
@@ -1,101 +0,0 @@
1
- import { P as PromisifyAssertion, T as Tester, E as ExpectStatic, l as BenchmarkResult } from './browser.d.DM1g8UNp.js';
2
- import { Plugin } from '@vitest/pretty-format';
3
- import { Test } from '@vitest/runner';
4
- import { i as SnapshotState, U as UserConsoleLog } from './general.d.DFAHgpC2.js';
5
-
6
- interface SnapshotMatcher<T> {
7
- <U extends { [P in keyof T] : any }>(snapshot: Partial<U>, hint?: string): void;
8
- (hint?: string): void;
9
- }
10
- interface InlineSnapshotMatcher<T> {
11
- <U extends { [P in keyof T] : any }>(properties: Partial<U>, snapshot?: string, hint?: string): void;
12
- (hint?: string): void;
13
- }
14
- declare module "vitest" {
15
- interface MatcherState {
16
- environment: string;
17
- snapshotState: SnapshotState;
18
- task?: Readonly<Test>;
19
- }
20
- interface ExpectPollOptions {
21
- interval?: number;
22
- timeout?: number;
23
- message?: string;
24
- }
25
- interface ExpectStatic {
26
- assert: Chai.AssertStatic;
27
- unreachable: (message?: string) => never;
28
- soft: <T>(actual: T, message?: string) => Assertion<T>;
29
- poll: <T>(actual: (options: {
30
- signal: AbortSignal;
31
- }) => T, options?: ExpectPollOptions) => PromisifyAssertion<Awaited<T>>;
32
- addEqualityTesters: (testers: Array<Tester>) => void;
33
- assertions: (expected: number) => void;
34
- hasAssertions: () => void;
35
- addSnapshotSerializer: (plugin: Plugin) => void;
36
- }
37
- interface Assertion<T> {
38
- matchSnapshot: SnapshotMatcher<T>;
39
- toMatchSnapshot: SnapshotMatcher<T>;
40
- toMatchInlineSnapshot: InlineSnapshotMatcher<T>;
41
- /**
42
- * Checks that an error thrown by a function matches a previously recorded snapshot.
43
- *
44
- * @param hint - Optional custom error message.
45
- *
46
- * @example
47
- * expect(functionWithError).toThrowErrorMatchingSnapshot();
48
- */
49
- toThrowErrorMatchingSnapshot: (hint?: string) => void;
50
- /**
51
- * Checks that an error thrown by a function matches an inline snapshot within the test file.
52
- * Useful for keeping snapshots close to the test code.
53
- *
54
- * @param snapshot - Optional inline snapshot string to match.
55
- * @param hint - Optional custom error message.
56
- *
57
- * @example
58
- * const throwError = () => { throw new Error('Error occurred') };
59
- * expect(throwError).toThrowErrorMatchingInlineSnapshot(`"Error occurred"`);
60
- */
61
- toThrowErrorMatchingInlineSnapshot: (snapshot?: string, hint?: string) => void;
62
- /**
63
- * Compares the received value to a snapshot saved in a specified file.
64
- * Useful for cases where snapshot content is large or needs to be shared across tests.
65
- *
66
- * @param filepath - Path to the snapshot file.
67
- * @param hint - Optional custom error message.
68
- *
69
- * @example
70
- * await expect(largeData).toMatchFileSnapshot('path/to/snapshot.json');
71
- */
72
- toMatchFileSnapshot: (filepath: string, hint?: string) => Promise<void>;
73
- }
74
- }
75
- declare module "@vitest/runner" {
76
- interface TestContext {
77
- /**
78
- * `expect` instance bound to the current test.
79
- *
80
- * This API is useful for running snapshot tests concurrently because global expect cannot track them.
81
- */
82
- readonly expect: ExpectStatic;
83
- /** @internal */
84
- _local: boolean;
85
- }
86
- interface TaskMeta {
87
- typecheck?: boolean;
88
- benchmark?: boolean;
89
- __vitest_label__?: string;
90
- }
91
- interface File {
92
- prepareDuration?: number;
93
- environmentLoad?: number;
94
- }
95
- interface TaskBase {
96
- logs?: UserConsoleLog[];
97
- }
98
- interface TaskResult {
99
- benchmark?: BenchmarkResult;
100
- }
101
- }