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.
Files changed (74) hide show
  1. package/LICENSE.md +36 -0
  2. package/dist/browser.d.ts +1 -1
  3. package/dist/browser.js +2 -2
  4. package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
  5. package/dist/chunks/{base.XJJQZiKB.js → base.DiopZV8F.js} +49 -14
  6. package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.BoqSLF53.js} +1 -1
  7. package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.BE4kbYok.d.ts} +4 -1
  8. package/dist/chunks/{cac.jRCLJDDc.js → cac.C4jjt2RX.js} +816 -14
  9. package/dist/chunks/{cli-api.Cx2DW4Bc.js → cli-api.ChbI1JU9.js} +412 -166
  10. package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.Cr1Ep39N.d.ts} +13 -11
  11. package/dist/chunks/{console.Cf-YriPC.js → console.CNlG1KsP.js} +3 -2
  12. package/dist/chunks/{constants.D_Q9UYh-.js → constants.B63TT-Bl.js} +1 -1
  13. package/dist/chunks/coverage.tyqbzn4W.js +1001 -0
  14. package/dist/chunks/{creator.DAmOKTvJ.js → creator.yyCHuw5R.js} +33 -2
  15. package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.JeWMqlOm.d.ts} +1 -1
  16. package/dist/chunks/{globals.DOayXfHP.js → globals.C6Ecf1TO.js} +11 -10
  17. package/dist/chunks/{index.M8mOzt4Y.js → index.B-iBE_Gx.js} +21 -5
  18. package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
  19. package/dist/chunks/{index.6Qv1eEA6.js → index.CAN630q3.js} +20 -8
  20. package/dist/chunks/{index.C5r1PdPD.js → index.CFulQRmC.js} +1 -1
  21. package/dist/chunks/{index.Z5E_ObnR.js → index.CouFDptX.js} +4 -2
  22. package/dist/chunks/{init-forks.BC6ZwHQN.js → init-forks.BnCXPazU.js} +1 -1
  23. package/dist/chunks/{init-threads.CxSxLC0N.js → init-threads.Cyh2PqXi.js} +1 -1
  24. package/dist/chunks/{init.C9kljSTm.js → init.B95Mm0Iz.js} +65 -12
  25. package/dist/chunks/native.mV0-490A.js +148 -0
  26. package/dist/chunks/nativeModuleMocker.D_q5sFv6.js +206 -0
  27. package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
  28. package/dist/chunks/{node.Ce0vMQM7.js → node.CrSEwhm4.js} +1 -1
  29. package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.C9o5bttz.d.ts} +1 -1
  30. package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.7faYdkxy.d.ts} +146 -49
  31. package/dist/chunks/rpc.DcRWTy5G.js +148 -0
  32. package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.CM7x9-sm.d.ts} +1 -0
  33. package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.cvFp-ao9.js} +2 -2
  34. package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.BK-u7y4N.js} +182 -391
  35. package/dist/chunks/{vi.2VT5v0um.js → test.G82XYNFk.js} +505 -119
  36. package/dist/chunks/{utils.DvEY5TfP.js → utils.DT4VyRyl.js} +5 -1
  37. package/dist/chunks/{vm.CMjifoPa.js → vm.BdLtzhnj.js} +15 -11
  38. package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.CPzI2ZzJ.d.ts} +2 -2
  39. package/dist/cli.js +4 -3
  40. package/dist/config.d.ts +11 -11
  41. package/dist/config.js +1 -1
  42. package/dist/coverage.d.ts +10 -8
  43. package/dist/coverage.js +7 -4
  44. package/dist/environments.js +2 -0
  45. package/dist/index.d.ts +30 -23
  46. package/dist/index.js +9 -8
  47. package/dist/module-evaluator.d.ts +10 -1
  48. package/dist/module-evaluator.js +1 -5
  49. package/dist/node.d.ts +13 -12
  50. package/dist/node.js +27 -25
  51. package/dist/nodejs-worker-loader.js +41 -0
  52. package/dist/reporters.d.ts +8 -8
  53. package/dist/reporters.js +4 -2
  54. package/dist/runners.d.ts +24 -4
  55. package/dist/runners.js +6 -6
  56. package/dist/runtime.d.ts +6 -0
  57. package/dist/runtime.js +35 -0
  58. package/dist/snapshot.js +4 -2
  59. package/dist/suite.js +4 -2
  60. package/dist/worker.d.ts +8 -7
  61. package/dist/worker.js +25 -20
  62. package/dist/workers/forks.js +21 -16
  63. package/dist/workers/runVmTests.js +11 -13
  64. package/dist/workers/threads.js +21 -16
  65. package/dist/workers/vmForks.js +14 -11
  66. package/dist/workers/vmThreads.js +14 -11
  67. package/package.json +28 -29
  68. package/suppress-warnings.cjs +1 -0
  69. package/dist/chunks/date.Bq6ZW5rf.js +0 -73
  70. package/dist/chunks/rpc.BoxB0q7B.js +0 -76
  71. package/dist/chunks/test.B8ej_ZHS.js +0 -254
  72. package/dist/mocker.d.ts +0 -1
  73. package/dist/mocker.js +0 -1
  74. 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, `vi.useFakeTimer({ toFake: ['setTimeout', 'performance'] })` will fake only `setTimeout()` and `performance.now()`
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
- * @default true
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
- * Don't throw error when asked to fake timers that are not present.
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: number;
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 './date.Bq6ZW5rf.js';
7
- import { g as getWorkerState } from './utils.DvEY5TfP.js';
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, defaultPort as a, defaultInspectPort as b, configFiles as c, defaultBrowserPort as d, globalApis as g };
36
+ export { API_PATH as A, defaultInspectPort as a, defaultPort as b, configFiles as c, defaultBrowserPort as d, globalApis as g };