vitest 4.0.9 → 4.0.11

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 (58) hide show
  1. package/dist/browser.d.ts +4 -3
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/_commonjsHelpers.D26ty3Ew.js +6 -0
  4. package/dist/chunks/{base.CiIV2DDC.js → base.DiCUKpyF.js} +47 -40
  5. package/dist/chunks/{browser.d.DnU_kh8a.d.ts → browser.d.D-d8eZY4.d.ts} +1 -1
  6. package/dist/chunks/{cac.B_NTJoIH.js → cac.aVhqBj0-.js} +21 -7
  7. package/dist/chunks/{cli-api.D48wY175.js → cli-api.-bIZD4XU.js} +960 -345
  8. package/dist/chunks/{coverage.BUlIqJrL.js → coverage.CtyeYmKM.js} +7 -1
  9. package/dist/chunks/{creator.BzqvXeRE.js → creator.DAmOKTvJ.js} +5 -5
  10. package/dist/chunks/{global.d.BQDgW9Pr.d.ts → global.d.uY4Q0M5z.d.ts} +1 -1
  11. package/dist/chunks/{globals.DBrtKPdh.js → globals.C0izxiX3.js} +3 -3
  12. package/dist/chunks/{index.op2Re5rn.js → index.CMvpbrsJ.js} +1 -1
  13. package/dist/chunks/{index.CPA8jGhR.js → index.CQwQ_SLL.js} +16 -4
  14. package/dist/chunks/{index.z7NPOg2E.js → index.D4KonVSU.js} +1 -1
  15. package/dist/chunks/{index.CGezRSGU.js → index.DBx1AtPJ.js} +3 -2
  16. package/dist/chunks/{index.kotH7DY7.js → index.DWDW6mLz.js} +15 -4
  17. package/dist/chunks/{index.BfmpdV5p.js → index.QWbK7rHY.js} +3 -3
  18. package/dist/chunks/init-forks.DIuGPyId.js +32 -0
  19. package/dist/chunks/{init-threads.C7T0-YMD.js → init-threads.jC_8JdoN.js} +3 -3
  20. package/dist/chunks/{init.BQhNfT0h.js → init.B3IeC_yW.js} +60 -22
  21. package/dist/chunks/{moduleRunner.d.BxT-OjLR.d.ts → moduleRunner.d.B5SW5pMI.d.ts} +9 -1
  22. package/dist/chunks/plugin.d.N8khPRFb.d.ts +38 -0
  23. package/dist/chunks/{reporters.d.BQ0wpUaj.d.ts → reporters.d.DgZLBdyd.d.ts} +109 -48
  24. package/dist/chunks/{setup-common.Dw1XgX0v.js → setup-common.DGHc_BUK.js} +2 -2
  25. package/dist/chunks/{startModuleRunner.DLjmA_wU.js → startModuleRunner.DaBMy1JT.js} +97 -49
  26. package/dist/chunks/{test.w5HLbjmU.js → test.DqQZzsWf.js} +15 -5
  27. package/dist/chunks/traces.BVPrsYso.js +151 -0
  28. package/dist/chunks/{config.d.BTfZNUu9.d.ts → traces.d.B8ukBJqA.d.ts} +36 -1
  29. package/dist/chunks/{vi.CyIUVSoU.js → vi.BiaV1qII.js} +2 -2
  30. package/dist/chunks/{vm.DXN8eCh2.js → vm.BKyGp1KW.js} +12 -8
  31. package/dist/chunks/{worker.d.ZGohxCEd.d.ts → worker.d.B_PZTrCQ.d.ts} +5 -4
  32. package/dist/cli.js +2 -2
  33. package/dist/config.d.ts +8 -7
  34. package/dist/coverage.d.ts +6 -5
  35. package/dist/coverage.js +2 -2
  36. package/dist/environments.js +1 -1
  37. package/dist/index.d.ts +14 -12
  38. package/dist/index.js +4 -4
  39. package/dist/module-evaluator.d.ts +7 -6
  40. package/dist/module-evaluator.js +14 -1
  41. package/dist/module-runner.js +2 -1
  42. package/dist/node.d.ts +11 -10
  43. package/dist/node.js +12 -11
  44. package/dist/reporters.d.ts +6 -5
  45. package/dist/reporters.js +2 -2
  46. package/dist/runners.d.ts +5 -1
  47. package/dist/runners.js +3 -3
  48. package/dist/worker.d.ts +8 -7
  49. package/dist/worker.js +11 -10
  50. package/dist/workers/forks.js +12 -12
  51. package/dist/workers/runVmTests.js +24 -22
  52. package/dist/workers/threads.js +12 -11
  53. package/dist/workers/vmForks.js +6 -6
  54. package/dist/workers/vmThreads.js +6 -5
  55. package/package.json +19 -14
  56. package/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -7
  57. package/dist/chunks/init-forks.aqTzCSR2.js +0 -65
  58. package/dist/chunks/plugin.d.DevON6kQ.d.ts +0 -9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "4.0.9",
4
+ "version": "4.0.11",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -130,19 +130,23 @@
130
130
  },
131
131
  "peerDependencies": {
132
132
  "@edge-runtime/vm": "*",
133
+ "@opentelemetry/api": "^1.9.0",
133
134
  "@types/debug": "^4.1.12",
134
135
  "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
135
136
  "happy-dom": "*",
136
137
  "jsdom": "*",
137
- "@vitest/browser-playwright": "4.0.9",
138
- "@vitest/browser-preview": "4.0.9",
139
- "@vitest/browser-webdriverio": "4.0.9",
140
- "@vitest/ui": "4.0.9"
138
+ "@vitest/browser-preview": "4.0.11",
139
+ "@vitest/browser-webdriverio": "4.0.11",
140
+ "@vitest/browser-playwright": "4.0.11",
141
+ "@vitest/ui": "4.0.11"
141
142
  },
142
143
  "peerDependenciesMeta": {
143
144
  "@edge-runtime/vm": {
144
145
  "optional": true
145
146
  },
147
+ "@opentelemetry/api": {
148
+ "optional": true
149
+ },
146
150
  "@types/debug": {
147
151
  "optional": true
148
152
  },
@@ -182,25 +186,26 @@
182
186
  "tinyrainbow": "^3.0.3",
183
187
  "vite": "^6.0.0 || ^7.0.0",
184
188
  "why-is-node-running": "^2.3.0",
185
- "@vitest/expect": "4.0.9",
186
- "@vitest/runner": "4.0.9",
187
- "@vitest/pretty-format": "4.0.9",
188
- "@vitest/snapshot": "4.0.9",
189
- "@vitest/spy": "4.0.9",
190
- "@vitest/utils": "4.0.9",
191
- "@vitest/mocker": "4.0.9"
189
+ "@vitest/expect": "4.0.11",
190
+ "@vitest/pretty-format": "4.0.11",
191
+ "@vitest/mocker": "4.0.11",
192
+ "@vitest/runner": "4.0.11",
193
+ "@vitest/snapshot": "4.0.11",
194
+ "@vitest/spy": "4.0.11",
195
+ "@vitest/utils": "4.0.11"
192
196
  },
193
197
  "devDependencies": {
194
198
  "@antfu/install-pkg": "^1.1.0",
195
199
  "@edge-runtime/vm": "^5.0.0",
196
200
  "@jridgewell/trace-mapping": "0.3.31",
201
+ "@opentelemetry/api": "^1.9.0",
197
202
  "@sinonjs/fake-timers": "14.0.0",
198
203
  "@types/debug": "^4.1.12",
199
204
  "@types/estree": "^1.0.8",
200
205
  "@types/istanbul-lib-coverage": "^2.0.6",
201
206
  "@types/istanbul-reports": "^3.0.4",
202
207
  "@types/jsdom": "^27.0.0",
203
- "@types/node": "^22.19.0",
208
+ "@types/node": "^24.10.1",
204
209
  "@types/picomatch": "^4.0.2",
205
210
  "@types/prompts": "^2.4.9",
206
211
  "@types/sinonjs__fake-timers": "^8.1.5",
@@ -210,7 +215,7 @@
210
215
  "empathic": "^2.0.0",
211
216
  "flatted": "^3.3.3",
212
217
  "happy-dom": "^20.0.10",
213
- "jsdom": "^27.1.0",
218
+ "jsdom": "^27.2.0",
214
219
  "local-pkg": "^1.1.2",
215
220
  "mime": "^4.1.0",
216
221
  "prompts": "^2.4.2",
@@ -1,7 +0,0 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function getDefaultExportFromCjs (x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
- }
6
-
7
- export { commonjsGlobal as c, getDefaultExportFromCjs as g };
@@ -1,65 +0,0 @@
1
- import v8 from 'node:v8';
2
- import { i as init } from './init.BQhNfT0h.js';
3
-
4
- if (!process.send) throw new Error("Expected worker to be run in node:child_process");
5
- // Store globals in case tests overwrite them
6
- const processExit = process.exit.bind(process);
7
- const processSend = process.send.bind(process);
8
- const processOn = process.on.bind(process);
9
- const processOff = process.off.bind(process);
10
- const processRemoveAllListeners = process.removeAllListeners.bind(process);
11
- // Work-around for nodejs/node#55094
12
- if (process.execArgv.some((execArg) => execArg.startsWith("--prof") || execArg.startsWith("--cpu-prof") || execArg.startsWith("--heap-prof") || execArg.startsWith("--diagnostic-dir"))) processOn("SIGTERM", () => processExit());
13
- function workerInit(options) {
14
- const { runTests } = options;
15
- init({
16
- post: (v) => processSend(v),
17
- on: (cb) => processOn("message", cb),
18
- off: (cb) => processOff("message", cb),
19
- teardown: () => processRemoveAllListeners("message"),
20
- serialize: v8.serialize,
21
- deserialize: (v) => v8.deserialize(Buffer.from(v)),
22
- runTests: (state) => executeTests("run", state),
23
- collectTests: (state) => executeTests("collect", state),
24
- setup: options.setup
25
- });
26
- async function executeTests(method, state) {
27
- state.ctx.config = unwrapSerializableConfig(state.ctx.config);
28
- try {
29
- await runTests(method, state);
30
- } finally {
31
- process.exit = processExit;
32
- }
33
- }
34
- }
35
- /**
36
- * Reverts the wrapping done by `wrapSerializableConfig` in {@link file://./../../node/pool/runtimes/forks.ts}
37
- */
38
- function unwrapSerializableConfig(config) {
39
- if (config.testNamePattern && typeof config.testNamePattern === "string") {
40
- const testNamePattern = config.testNamePattern;
41
- if (testNamePattern.startsWith("$$vitest:")) config.testNamePattern = parseRegexp(testNamePattern.slice(9));
42
- }
43
- if (config.defines && Array.isArray(config.defines.keys) && config.defines.original) {
44
- const { keys, original } = config.defines;
45
- const defines = {};
46
- // Apply all keys from the original. Entries which had undefined value are missing from original now
47
- for (const key of keys) defines[key] = original[key];
48
- config.defines = defines;
49
- }
50
- return config;
51
- }
52
- function parseRegexp(input) {
53
- // Parse input
54
- // eslint-disable-next-line regexp/no-misleading-capturing-group
55
- const m = input.match(/(\/?)(.+)\1([a-z]*)/i);
56
- // match nothing
57
- if (!m) return /$^/;
58
- // Invalid flags
59
- // eslint-disable-next-line regexp/optimal-quantifier-concatenation
60
- if (m[3] && !/^(?!.*?(.).*?\1)[gmixXsuUAJ]+$/.test(m[3])) return new RegExp(input);
61
- // Create the regular expression
62
- return new RegExp(m[2], m[3]);
63
- }
64
-
65
- export { workerInit as w };
@@ -1,9 +0,0 @@
1
- import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.BQ0wpUaj.js';
2
-
3
- interface VitestPluginContext {
4
- vitest: Vitest;
5
- project: TestProject;
6
- injectTestProjects: (config: TestProjectConfiguration | TestProjectConfiguration[]) => Promise<TestProject[]>;
7
- }
8
-
9
- export type { VitestPluginContext as V };