vitest 5.0.2 → 5.0.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 (79) hide show
  1. package/LICENSE.md +29 -1
  2. package/browser/context.d.ts +7 -1
  3. package/browser/context.js +5 -5
  4. package/dist/browser.d.ts +4 -4
  5. package/dist/browser.js +11 -11
  6. package/dist/chunks/{base.5tQXSzMP.js → base.CYbb9pQW.js} +39 -15
  7. package/dist/chunks/{browser.d.g5Thl309.d.ts → browser.d.FGQ9_rK6.d.ts} +3 -3
  8. package/dist/chunks/{cac.BLbEtnDd.js → cac.DTXWs6Ni.js} +21 -23
  9. package/dist/chunks/cli-api.Bx28WXzL.js +13879 -0
  10. package/dist/chunks/{config.d.CU_b-wJj.d.ts → config.d.QBNYCgFU.d.ts} +33 -24
  11. package/dist/chunks/{console.B09ye7y0.js → console.DtI4yxfN.js} +5 -4
  12. package/dist/chunks/{coverage.AipniaqB.js → coverage.-bm5IxnW.js} +1 -1
  13. package/dist/chunks/{coverage.CX7NN5s7.js → coverage.cTDc4uSS.js} +1 -1
  14. package/dist/chunks/{creator.2VTnpYzN.js → creator.CLL8QFMS.js} +44 -54
  15. package/dist/chunks/{defaults.D2ip7f-X.js → defaults.B1FCaFfh.js} +2 -2
  16. package/dist/chunks/{display.pkpxlVcY.js → display.BlTmubjj.js} +1 -1
  17. package/dist/chunks/{doctor.BCXa6-1R.js → doctor.Bqc8NDDb.js} +40 -41
  18. package/dist/chunks/{env.DzFJjrmK.js → env.BKKtU2WC.js} +1 -1
  19. package/dist/chunks/{environment.d.C6xYahWA.d.ts → environment.d.BY56MoGs.d.ts} +1 -1
  20. package/dist/chunks/{globals.Brdv9iOs.js → globals.CTWMSIPL.js} +10 -10
  21. package/dist/chunks/{index.C-uw7tH9.js → index.B8VfM7Mf.js} +8606 -20822
  22. package/dist/chunks/{index.DXQx-kDM.js → index.BoyTG_B7.js} +9 -4
  23. package/dist/chunks/{index.hTNFpC24.js → index.CPNMO3h-.js} +73 -50
  24. package/dist/chunks/{index.M2dsQ_UQ.js → index.D0heQG4v.js} +557 -183
  25. package/dist/chunks/{index.BgwtGYxD.js → index.GYMZ12wH.js} +5 -5
  26. package/dist/chunks/{index.DGdajAO2.js → index.uwTEEBsB.js} +94 -71
  27. package/dist/chunks/{init-forks.CdGu3HUy.js → init-forks.CbYYa5xq.js} +1 -1
  28. package/dist/chunks/{init-threads.2f_lsHNK.js → init-threads.DtjdvxPl.js} +1 -1
  29. package/dist/chunks/{init.IsjtLXKe.js → init.DrHtV5zd.js} +7 -7
  30. package/dist/chunks/module-dependencies.CwNPkcV4.js +71 -0
  31. package/dist/chunks/{native.CF4uT5hY.js → native.cdzHIdmv.js} +48 -34
  32. package/dist/chunks/{nativeModuleMocker.DwRB4F9R.js → nativeModuleMocker.D8f4cW4A.js} +2 -2
  33. package/dist/chunks/{nativeModuleRunner.J0QLzNtK.js → nativeModuleRunner.xi64Afb2.js} +1 -1
  34. package/dist/chunks/{node.CfQ_OGWr.js → node.uQulW0ei.js} +1 -1
  35. package/dist/chunks/{pathe.M-eThtNZ.DwEga6ro.js → pathe.M-eThtNZ.Ba-7h1rE.js} +9 -7
  36. package/dist/chunks/{plugin.d.My_z-jmU.d.ts → plugin.d.C8mmycim.d.ts} +109 -68
  37. package/dist/chunks/{plugins.Cigb0uSy.js → plugins.DPQHVT0p.js} +1 -1
  38. package/dist/chunks/{resolver.NpfwMKt9.js → resolver.CtCcxIy1.js} +1 -1
  39. package/dist/chunks/{rpc.CJVl3hZH.js → rpc.DpkUyY1N.js} +3 -2
  40. package/dist/chunks/{rpc.d.DA9Utv4e.d.ts → rpc.d.Cft1biqy.d.ts} +2 -1
  41. package/dist/chunks/{run.C5UmxDPh.js → run.Cm2sd7-x.js} +122 -97
  42. package/dist/chunks/{setup-common.Ct8rQvjH.js → setup-common.BABL3z3m.js} +3 -3
  43. package/dist/chunks/{source-map.BH0bbrs9.js → source-map.DdKI5IHB.js} +15 -10
  44. package/dist/chunks/{source-map.d.YqWNcp4e.d.ts → source-map.d.kzFtk_dj.d.ts} +1 -1
  45. package/dist/chunks/{spy.KLHgXex_.js → spy.DDMXghXv.js} +63 -32
  46. package/dist/chunks/{task-utils.d.BZm4GSQD.d.ts → task-utils.d.PFh2BV6Q.d.ts} +1 -1
  47. package/dist/chunks/tinyrainbow.Do8I1XRG.js +88 -0
  48. package/dist/chunks/{utils.CJ0JImL8.js → utils.DSfl_w8V.js} +44 -42
  49. package/dist/chunks/{vm.KI2AYADz.js → vm.Uo_C9Uld.js} +16 -13
  50. package/dist/chunks/{worker.d.MLmnzOJE.d.ts → worker.d.BH-r1bPu.d.ts} +8 -3
  51. package/dist/cli.js +4 -4
  52. package/dist/config.cjs +1 -1
  53. package/dist/config.d.ts +9 -10
  54. package/dist/config.js +2 -2
  55. package/dist/index.d.ts +10 -10
  56. package/dist/index.js +10 -10
  57. package/dist/module-evaluator.d.ts +3 -2
  58. package/dist/module-evaluator.js +8 -5
  59. package/dist/node.d.ts +9 -10
  60. package/dist/node.js +27 -26
  61. package/dist/runtime.d.ts +6 -6
  62. package/dist/runtime.js +4 -4
  63. package/dist/spy.js +1 -1
  64. package/dist/task-utils.js +7 -4
  65. package/dist/worker.d.ts +4 -4
  66. package/dist/worker.js +21 -20
  67. package/dist/workers/forks.js +19 -18
  68. package/dist/workers/runVmTests.js +23 -14
  69. package/dist/workers/threads.js +19 -18
  70. package/dist/workers/vmForks.js +13 -13
  71. package/dist/workers/vmThreads.js +13 -13
  72. package/globals.d.ts +19 -19
  73. package/index.cjs +3 -3
  74. package/optional-runtime-types.d.ts +1 -1
  75. package/optional-types.d.ts +1 -1
  76. package/package.json +35 -29
  77. package/suppress-warnings.cjs +1 -1
  78. package/dist/chunks/cli-api.DL4Bd7Vh.js +0 -528
  79. package/dist/chunks/tinyrainbow.Ht9iggcq.js +0 -95
@@ -1,12 +1,12 @@
1
- import { w as workerInit } from '../chunks/init-forks.CdGu3HUy.js';
2
- import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.KI2AYADz.js';
3
- import '../chunks/init.IsjtLXKe.js';
1
+ import { w as workerInit } from '../chunks/init-forks.CbYYa5xq.js';
2
+ import { r as runVmTests, s as setupVmWorker } from '../chunks/vm.Uo_C9Uld.js';
3
+ import '../chunks/init.DrHtV5zd.js';
4
4
  import 'node:fs';
5
5
  import 'node:module';
6
6
  import 'node:url';
7
7
  import 'vite/module-runner';
8
- import '../chunks/index.hTNFpC24.js';
9
- import '../chunks/pathe.M-eThtNZ.DwEga6ro.js';
8
+ import '../chunks/index.CPNMO3h-.js';
9
+ import '../chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
10
10
  import '../chunks/modules.BJuCwlRJ.js';
11
11
  import '../chunks/utils.DYj33du9.js';
12
12
  import '../path.js';
@@ -17,19 +17,19 @@ import '../traces.js';
17
17
  import '@vitest/mocker';
18
18
  import '@vitest/mocker/redirect';
19
19
  import 'node:console';
20
- import '../chunks/source-map.BH0bbrs9.js';
21
- import '../chunks/index.M2dsQ_UQ.js';
22
- import '../chunks/tinyrainbow.Ht9iggcq.js';
23
- import '../chunks/rpc.CJVl3hZH.js';
20
+ import '../chunks/source-map.DdKI5IHB.js';
21
+ import '../chunks/index.D0heQG4v.js';
22
+ import '../chunks/tinyrainbow.Do8I1XRG.js';
23
+ import '../chunks/rpc.DpkUyY1N.js';
24
24
  import '../chunks/index.DmDMHCg8.js';
25
25
  import '../chunks/inspector.CvyFGlXm.js';
26
26
  import 'node:v8';
27
- import '../chunks/console.B09ye7y0.js';
27
+ import '../chunks/console.DtI4yxfN.js';
28
28
  import 'node:stream';
29
- import '../chunks/resolver.NpfwMKt9.js';
29
+ import '../chunks/resolver.CtCcxIy1.js';
30
30
  import 'es-module-lexer';
31
- import '../chunks/setup-common.Ct8rQvjH.js';
32
- import '../chunks/plugins.Cigb0uSy.js';
31
+ import '../chunks/setup-common.BABL3z3m.js';
32
+ import '../chunks/plugins.DPQHVT0p.js';
33
33
 
34
34
  workerInit({
35
35
  runTests: runVmTests,
@@ -1,13 +1,13 @@
1
- import { w as workerInit } from '../chunks/init-threads.2f_lsHNK.js';
2
- import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.KI2AYADz.js';
1
+ import { w as workerInit } from '../chunks/init-threads.DtjdvxPl.js';
2
+ import { s as setupVmWorker, r as runVmTests } from '../chunks/vm.Uo_C9Uld.js';
3
3
  import 'node:worker_threads';
4
- import '../chunks/init.IsjtLXKe.js';
4
+ import '../chunks/init.DrHtV5zd.js';
5
5
  import 'node:fs';
6
6
  import 'node:module';
7
7
  import 'node:url';
8
8
  import 'vite/module-runner';
9
- import '../chunks/index.hTNFpC24.js';
10
- import '../chunks/pathe.M-eThtNZ.DwEga6ro.js';
9
+ import '../chunks/index.CPNMO3h-.js';
10
+ import '../chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
11
11
  import '../chunks/modules.BJuCwlRJ.js';
12
12
  import '../chunks/utils.DYj33du9.js';
13
13
  import '../path.js';
@@ -18,19 +18,19 @@ import '../traces.js';
18
18
  import '@vitest/mocker';
19
19
  import '@vitest/mocker/redirect';
20
20
  import 'node:console';
21
- import '../chunks/source-map.BH0bbrs9.js';
22
- import '../chunks/index.M2dsQ_UQ.js';
23
- import '../chunks/tinyrainbow.Ht9iggcq.js';
24
- import '../chunks/rpc.CJVl3hZH.js';
21
+ import '../chunks/source-map.DdKI5IHB.js';
22
+ import '../chunks/index.D0heQG4v.js';
23
+ import '../chunks/tinyrainbow.Do8I1XRG.js';
24
+ import '../chunks/rpc.DpkUyY1N.js';
25
25
  import '../chunks/index.DmDMHCg8.js';
26
26
  import '../chunks/inspector.CvyFGlXm.js';
27
27
  import 'node:v8';
28
- import '../chunks/console.B09ye7y0.js';
28
+ import '../chunks/console.DtI4yxfN.js';
29
29
  import 'node:stream';
30
- import '../chunks/resolver.NpfwMKt9.js';
30
+ import '../chunks/resolver.CtCcxIy1.js';
31
31
  import 'es-module-lexer';
32
- import '../chunks/setup-common.Ct8rQvjH.js';
33
- import '../chunks/plugins.Cigb0uSy.js';
32
+ import '../chunks/setup-common.BABL3z3m.js';
33
+ import '../chunks/plugins.DPQHVT0p.js';
34
34
 
35
35
  workerInit({
36
36
  runTests: runVmTests,
package/globals.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  declare global {
2
- let suite: typeof import('vitest')['suite']
3
- let test: typeof import('vitest')['test']
4
- let chai: typeof import("vitest")["chai"]
5
- let describe: typeof import('vitest')['describe']
6
- let it: typeof import('vitest')['it']
7
- let expectTypeOf: typeof import('vitest')['expectTypeOf']
8
- let assertType: typeof import('vitest')['assertType']
9
- let expect: typeof import('vitest')['expect']
10
- let assert: typeof import('vitest')['assert']
11
- let vitest: typeof import('vitest')['vitest']
12
- let vi: typeof import('vitest')['vitest']
13
- let beforeAll: typeof import('vitest')['beforeAll']
14
- let afterAll: typeof import('vitest')['afterAll']
15
- let beforeEach: typeof import('vitest')['beforeEach']
16
- let afterEach: typeof import('vitest')['afterEach']
17
- let aroundEach: typeof import('vitest')['aroundEach']
18
- let aroundAll: typeof import('vitest')['aroundAll']
19
- let onTestFailed: typeof import('vitest')['onTestFailed']
20
- let onTestFinished: typeof import('vitest')['onTestFinished']
2
+ let suite: (typeof import('vitest'))['suite']
3
+ let test: (typeof import('vitest'))['test']
4
+ let chai: (typeof import('vitest'))['chai']
5
+ let describe: (typeof import('vitest'))['describe']
6
+ let it: (typeof import('vitest'))['it']
7
+ let expectTypeOf: (typeof import('vitest'))['expectTypeOf']
8
+ let assertType: (typeof import('vitest'))['assertType']
9
+ let expect: (typeof import('vitest'))['expect']
10
+ let assert: (typeof import('vitest'))['assert']
11
+ let vitest: (typeof import('vitest'))['vitest']
12
+ let vi: (typeof import('vitest'))['vitest']
13
+ let beforeAll: (typeof import('vitest'))['beforeAll']
14
+ let afterAll: (typeof import('vitest'))['afterAll']
15
+ let beforeEach: (typeof import('vitest'))['beforeEach']
16
+ let afterEach: (typeof import('vitest'))['afterEach']
17
+ let aroundEach: (typeof import('vitest'))['aroundEach']
18
+ let aroundAll: (typeof import('vitest'))['aroundAll']
19
+ let onTestFailed: (typeof import('vitest'))['onTestFailed']
20
+ let onTestFinished: (typeof import('vitest'))['onTestFinished']
21
21
  }
22
22
  export {}
package/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  throw new Error(
2
- 'Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.'
3
- + '\n\nIf you are using "import" in your source code, then it\'s possible it was bundled into require() automatically by your bundler. '
4
- + 'In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules.',
2
+ 'Vitest cannot be imported in a CommonJS module using require(). Please use "import" instead.' +
3
+ '\n\nIf you are using "import" in your source code, then it\'s possible it was bundled into require() automatically by your bundler. ' +
4
+ 'In that case, do not bundle CommonJS output since it will never work with Vitest, or use dynamic import() which is available in all CommonJS modules.',
5
5
  )
@@ -1,4 +1,4 @@
1
- /* eslint-disable ts/ban-ts-comment */
1
+ /* oxlint-disable typescript/ban-ts-comment */
2
2
 
3
3
  export interface Disposable {
4
4
  // @ts-ignore -- Symbol.dispose might not be in user types
@@ -1,4 +1,4 @@
1
- /* eslint-disable ts/ban-ts-comment */
1
+ /* oxlint-disable typescript/ban-ts-comment */
2
2
 
3
3
  // @ts-ignore optional peer dep
4
4
  export type * as jsdomTypes from 'jsdom'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "5.0.2",
4
+ "version": "5.0.4",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "exports": {
34
34
  ".": {
35
+ "__vitest_source__": "./src/public/index.ts",
35
36
  "import": {
36
37
  "types": "./dist/index.d.ts",
37
38
  "default": "./dist/index.js"
@@ -65,6 +66,7 @@
65
66
  "types": "./import-meta.d.ts"
66
67
  },
67
68
  "./node": {
69
+ "__vitest_source__": "./src/public/node.ts",
68
70
  "types": "./dist/node.d.ts",
69
71
  "default": "./dist/node.js"
70
72
  },
@@ -78,15 +80,18 @@
78
80
  "default": "./dist/traces.js"
79
81
  },
80
82
  "./config": {
83
+ "__vitest_source__": "./src/public/config.ts",
81
84
  "types": "./config.d.ts",
82
85
  "require": "./dist/config.cjs",
83
86
  "default": "./dist/config.js"
84
87
  },
85
88
  "./runtime": {
89
+ "__vitest_source__": "./src/public/runtime.ts",
86
90
  "types": "./dist/runtime.d.ts",
87
91
  "default": "./dist/runtime.js"
88
92
  },
89
93
  "./worker": {
94
+ "__vitest_source__": "./src/public/worker.ts",
90
95
  "types": "./worker.d.ts",
91
96
  "default": "./dist/worker.js"
92
97
  }
@@ -113,12 +118,12 @@
113
118
  "@edge-runtime/vm": "*",
114
119
  "@opentelemetry/api": "^1.9.0",
115
120
  "@types/node": "^22.0.0 || >=24.0.0",
116
- "@vitest/browser-playwright": "5.0.2",
117
- "@vitest/browser-preview": "5.0.2",
121
+ "@vitest/browser-playwright": "5.0.4",
122
+ "@vitest/browser-preview": "5.0.4",
118
123
  "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
119
- "@vitest/coverage-istanbul": "5.0.2",
120
- "@vitest/coverage-v8": "5.0.2",
121
- "@vitest/ui": "5.0.2",
124
+ "@vitest/coverage-istanbul": "5.0.4",
125
+ "@vitest/coverage-v8": "5.0.4",
126
+ "@vitest/ui": "5.0.4",
122
127
  "happy-dom": "*",
123
128
  "jsdom": "*",
124
129
  "vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
@@ -163,53 +168,54 @@
163
168
  },
164
169
  "dependencies": {
165
170
  "@types/chai": "^5.2.2",
166
- "@vitest/mocker": "5.0.2",
167
- "chai": "^6.2.2",
171
+ "@vitest/mocker": "5.0.4",
172
+ "chai": "^6.3.0",
168
173
  "es-module-lexer": "^2.3.2",
169
174
  "expect-type": "^1.4.0",
170
- "magic-string": "^1.2.3",
171
- "obug": "^2.1.4",
175
+ "magic-string": "^1.4.3",
176
+ "obug": "^3.0.0",
172
177
  "picomatch": "^4.0.7",
173
- "std-env": "^4.2.0",
174
- "tinybench": "^6.1.4",
175
- "tinyexec": "^1.3.0",
178
+ "std-env": "^4.3.0",
179
+ "tinybench": "^6.2.2",
180
+ "tinyexec": "^1.3.1",
176
181
  "tinyglobby": "^0.2.17",
177
- "why-is-node-running": "^3.2.1"
182
+ "why-is-node-running": "3.2.1"
178
183
  },
179
184
  "devDependencies": {
180
- "@antfu/install-pkg": "^2.0.1",
185
+ "@antfu/install-pkg": "^2.1.0",
181
186
  "@bomb.sh/tab": "^0.0.22",
182
187
  "@edge-runtime/vm": "^5.0.0",
183
188
  "@jridgewell/trace-mapping": "0.3.31",
184
189
  "@opentelemetry/api": "^1.9.1",
185
190
  "@sinonjs/fake-timers": "15.4.0",
186
- "@types/jsdom": "^28.0.3",
187
- "@types/node": "^24.13.3",
191
+ "@types/jsdom": "^30.0.0",
192
+ "@types/node": "^24.19.2",
188
193
  "@types/picomatch": "^4.0.3",
189
194
  "@types/prompts": "^2.4.9",
190
- "@vitest/expect": "5.0.2",
191
- "@vitest/istanbul-lib-coverage": "^1.0.0",
192
- "@vitest/istanbul-lib-report": "^1.0.0",
193
- "@vitest/pretty-format": "5.0.2",
194
- "@vitest/snapshot": "5.0.2",
195
- "@vitest/spy": "5.0.2",
196
- "@vitest/utils": "5.0.2",
195
+ "@types/ws": "^8.18.2",
196
+ "@vitest/expect": "5.0.4",
197
+ "@vitest/istanbul-lib-coverage": "^1.0.2",
198
+ "@vitest/istanbul-lib-report": "^1.0.2",
199
+ "@vitest/pretty-format": "5.0.4",
200
+ "@vitest/snapshot": "5.0.4",
201
+ "@vitest/spy": "5.0.4",
202
+ "@vitest/utils": "5.0.4",
197
203
  "acorn": "8.11.3",
198
204
  "acorn-walk": "^8.3.5",
199
205
  "birpc": "^4.2.0",
200
206
  "cac": "^6.7.14",
201
207
  "flatted": "^3.4.4",
202
- "happy-dom": "^20.12.0",
203
- "jsdom": "^29.1.1",
208
+ "happy-dom": "^20.14.6",
209
+ "jsdom": "^30.1.2",
204
210
  "local-pkg": "^1.2.1",
205
211
  "mime": "^4.1.0",
206
212
  "pathe": "^2.0.3",
207
213
  "prompts": "^2.4.2",
208
- "strip-literal": "^3.1.0",
214
+ "strip-literal": "^4.0.0",
209
215
  "tinyhighlight": "^0.3.2",
210
- "tinyrainbow": "^3.1.1",
216
+ "tinyrainbow": "^3.2.0",
211
217
  "vite": "^6.4.0 || ^7.0.0 || ^8.0.0",
212
- "ws": "^8.21.3"
218
+ "ws": "^8.22.0"
213
219
  },
214
220
  "scripts": {
215
221
  "build": "premove dist && rollup -c",
@@ -17,6 +17,6 @@ process.emit = function (event, warning) {
17
17
  return
18
18
  }
19
19
 
20
- // eslint-disable-next-line prefer-rest-params
20
+ // oxlint-disable-next-line prefer-rest-params
21
21
  return Reflect.apply(emit, this, arguments)
22
22
  }