vitest 3.1.0 → 3.1.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 (61) hide show
  1. package/LICENSE.md +0 -44
  2. package/dist/browser.d.ts +4 -3
  3. package/dist/browser.js +3 -3
  4. package/dist/chunks/{base.bV8rwssx.js → base.k5EeHg0m.js} +2 -2
  5. package/dist/chunks/{benchmark.BKUatJGy.js → benchmark.BoF7jW0Q.js} +1 -1
  6. package/dist/chunks/{cac.1WcTh-zl.js → cac.C5_4mAsf.js} +8 -8
  7. package/dist/chunks/{cli-api.2yb7XCwB.js → cli-api.z029PxYZ.js} +221 -3494
  8. package/dist/chunks/{config.d.DevWltVl.d.ts → config.d.UqE-KR0o.d.ts} +2 -2
  9. package/dist/chunks/{console.D6t261w0.js → console.K1NMVOSc.js} +1 -1
  10. package/dist/chunks/{coverage.SfnlalVs.js → coverage.BUdIvXbr.js} +9 -6
  11. package/dist/chunks/{defaults.DmfNPoe5.js → defaults.DSxsTG0h.js} +1 -1
  12. package/dist/chunks/{environment.d.C8UItCbf.d.ts → environment.d.Dmw5ulng.d.ts} +5 -58
  13. package/dist/chunks/{global.d.Cg2sEPIm.d.ts → global.d.CXRAxnWc.d.ts} +1 -1
  14. package/dist/chunks/{globals.DCbUWjip.js → globals.CZAEe_Gf.js} +5 -5
  15. package/dist/chunks/{index.BDobFbcz.js → index.B0uVAVvx.js} +3 -3
  16. package/dist/chunks/{index.68735LiX.js → index.CJ0plNrh.js} +37 -8
  17. package/dist/chunks/{index.VfYQ6MXY.js → index.Cu2UlluP.js} +4 -4
  18. package/dist/chunks/{index.CwHmn5H5.js → index._vwY_KdO.js} +5 -8
  19. package/dist/chunks/{node.IqGoMrm4.js → node.3xsWotC9.js} +1 -1
  20. package/dist/chunks/{reporters.d.CfRkRKN2.d.ts → reporters.d.79o4mouw.d.ts} +14 -9
  21. package/dist/chunks/{rpc.DGgL5dw7.js → rpc.D9_013TY.js} +2 -2
  22. package/dist/chunks/{run-once.I7PpBOk1.js → run-once.Dimr7O9f.js} +1 -1
  23. package/dist/chunks/{runBaseTests.CqmKSG99.js → runBaseTests.BV8m0B-u.js} +10 -10
  24. package/dist/chunks/{setup-common.DEGDGBiA.js → setup-common.AQcDs321.js} +2 -2
  25. package/dist/chunks/{typechecker.CG0zmr19.js → typechecker.DYQbn8uK.js} +2 -2
  26. package/dist/chunks/{utils.Lot3J_8U.js → utils.Cc45eY3L.js} +10 -4
  27. package/dist/chunks/{utils.CtocqOoE.js → utils.CgTj3MsC.js} +1 -1
  28. package/dist/chunks/{vi.B-PuvDzu.js → vi.ClIskdbk.js} +1 -1
  29. package/dist/chunks/{vite.d.4pkSbgmp.d.ts → vite.d.BVr6Nvdj.d.ts} +1 -1
  30. package/dist/chunks/{vm.Lp7mPCVW.js → vm.BmHENIuV.js} +16 -8
  31. package/dist/chunks/{worker.d.CSFlSYJg.d.ts → worker.d.C-KN07Ls.d.ts} +1 -1
  32. package/dist/chunks/{worker.d.C58isfFm.d.ts → worker.d.CHGSOG0s.d.ts} +21 -4
  33. package/dist/cli.js +1 -1
  34. package/dist/config.cjs +1 -1
  35. package/dist/config.d.ts +9 -7
  36. package/dist/config.js +1 -1
  37. package/dist/coverage.d.ts +6 -4
  38. package/dist/coverage.js +4 -4
  39. package/dist/environments.d.ts +3 -2
  40. package/dist/execute.d.ts +4 -3
  41. package/dist/index.d.ts +12 -10
  42. package/dist/index.js +5 -5
  43. package/dist/node.d.ts +10 -8
  44. package/dist/node.js +12 -11
  45. package/dist/reporters.d.ts +6 -4
  46. package/dist/reporters.js +3 -3
  47. package/dist/runners.d.ts +1 -1
  48. package/dist/runners.js +5 -5
  49. package/dist/snapshot.js +2 -2
  50. package/dist/suite.js +2 -2
  51. package/dist/worker.js +3 -3
  52. package/dist/workers/forks.js +2 -2
  53. package/dist/workers/runVmTests.js +9 -9
  54. package/dist/workers/threads.js +2 -2
  55. package/dist/workers/vmForks.js +3 -3
  56. package/dist/workers/vmThreads.js +3 -3
  57. package/dist/workers.d.ts +5 -4
  58. package/dist/workers.js +6 -6
  59. package/globals.d.ts +1 -0
  60. package/optional-types.d.ts +7 -0
  61. package/package.json +17 -17
package/LICENSE.md CHANGED
@@ -257,21 +257,6 @@ Repository: https://github.com/debitoor/chai-subset.git
257
257
 
258
258
  ---------------------------------------
259
259
 
260
- ## fdir
261
- License: MIT
262
- By: thecodrr
263
- Repository: git+https://github.com/thecodrr/fdir.git
264
-
265
- > Copyright 2023 Abdullah Atta
266
- >
267
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
268
- >
269
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
270
- >
271
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
272
-
273
- ---------------------------------------
274
-
275
260
  ## fill-range
276
261
  License: MIT
277
262
  By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling
@@ -797,35 +782,6 @@ Repository: git+https://github.com/antfu/strip-literal.git
797
782
 
798
783
  ---------------------------------------
799
784
 
800
- ## tinyglobby
801
- License: MIT
802
- By: Superchupu
803
- Repository: git+https://github.com/SuperchupuDev/tinyglobby.git
804
-
805
- > MIT License
806
- >
807
- > Copyright (c) 2024 Madeline Gurriarán
808
- >
809
- > Permission is hereby granted, free of charge, to any person obtaining a copy
810
- > of this software and associated documentation files (the "Software"), to deal
811
- > in the Software without restriction, including without limitation the rights
812
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
813
- > copies of the Software, and to permit persons to whom the Software is
814
- > furnished to do so, subject to the following conditions:
815
- >
816
- > The above copyright notice and this permission notice shall be included in all
817
- > copies or substantial portions of the Software.
818
- >
819
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
820
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
821
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
822
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
823
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
824
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
825
- > SOFTWARE.
826
-
827
- ---------------------------------------
828
-
829
785
  ## to-regex-range
830
786
  License: MIT
831
787
  By: Jon Schlinkert, Rouven Weßling
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.DevWltVl.js';
1
+ import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.UqE-KR0o.js';
2
2
  import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.S9RMNXIe.js';
3
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
4
4
  import { VitestExecutor } from './execute.js';
@@ -10,8 +10,9 @@ import '@vitest/snapshot';
10
10
  import '@vitest/snapshot/environment';
11
11
  import 'vite-node/client';
12
12
  import 'vite-node';
13
- import './chunks/worker.d.C58isfFm.js';
14
- import './chunks/environment.d.C8UItCbf.js';
13
+ import './chunks/worker.d.CHGSOG0s.js';
14
+ import './chunks/environment.d.Dmw5ulng.js';
15
+ import 'vitest/optional-types.js';
15
16
  import 'node:vm';
16
17
  import '@vitest/mocker';
17
18
  import './chunks/mocker.d.BE_2ls6u.js';
package/dist/browser.js CHANGED
@@ -1,9 +1,9 @@
1
- export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.DEGDGBiA.js';
1
+ export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.AQcDs321.js';
2
2
  export { collectTests, processError, startTests } from '@vitest/runner';
3
3
  import * as spy from '@vitest/spy';
4
4
  export { spy as SpyModule };
5
5
  import './chunks/coverage.0iPg4Wrz.js';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/utils';
8
- import './chunks/run-once.I7PpBOk1.js';
9
- import './chunks/utils.CtocqOoE.js';
8
+ import './chunks/run-once.Dimr7O9f.js';
9
+ import './chunks/utils.CgTj3MsC.js';
@@ -1,6 +1,6 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
2
  import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.CwmnH2oH.js';
3
- import { p as provideWorkerState } from './utils.CtocqOoE.js';
3
+ import { p as provideWorkerState } from './utils.CgTj3MsC.js';
4
4
 
5
5
  let _viteNode;
6
6
  const moduleCache = new ModuleCacheMap();
@@ -27,7 +27,7 @@ async function runBaseTests(method, state) {
27
27
  const [executor, { run }] = await Promise.all([startViteNode({
28
28
  state,
29
29
  requestStubs: getDefaultRequestStubs()
30
- }), import('./runBaseTests.CqmKSG99.js')]);
30
+ }), import('./runBaseTests.BV8m0B-u.js')]);
31
31
  const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
32
32
  filepath: f,
33
33
  testLocations: undefined
@@ -1,7 +1,7 @@
1
1
  import { getCurrentSuite } from '@vitest/runner';
2
2
  import { createChainable } from '@vitest/runner/utils';
3
3
  import { noop } from '@vitest/utils';
4
- import { g as getWorkerState } from './utils.CtocqOoE.js';
4
+ import { g as getWorkerState } from './utils.CgTj3MsC.js';
5
5
 
6
6
  const benchFns = new WeakMap();
7
7
  const benchOptsMap = new WeakMap();
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
618
618
 
619
619
  const cac = (name = "") => new CAC(name);
620
620
 
621
- var version = "3.1.0";
621
+ var version = "3.1.2";
622
622
 
623
623
  const apiConfig = (port) => ({
624
624
  port: {
@@ -884,7 +884,7 @@ const cliOptionsConfig = {
884
884
  subcommands: apiConfig(defaultBrowserPort)
885
885
  },
886
886
  provider: {
887
- description: "Provider used to run browser tests. Some browsers are only available for specific providers. Can be \"webdriverio\", \"playwright\", \"preview\", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/config/#browser-provider) for more information (default: `\"preview\"`)",
887
+ description: "Provider used to run browser tests. Some browsers are only available for specific providers. Can be \"webdriverio\", \"playwright\", \"preview\", or the path to a custom provider. Visit [`browser.provider`](https://vitest.dev/guide/browser/config.html#browser-provider) for more information (default: `\"preview\"`)",
888
888
  argument: "<name>",
889
889
  subcommands: null
890
890
  },
@@ -1464,14 +1464,14 @@ async function start(mode, cliFilters, options) {
1464
1464
  process.title = "node (vitest)";
1465
1465
  } catch {}
1466
1466
  try {
1467
- const { startVitest } = await import('./cli-api.2yb7XCwB.js').then(function (n) { return n.f; });
1467
+ const { startVitest } = await import('./cli-api.z029PxYZ.js').then(function (n) { return n.f; });
1468
1468
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1469
1469
  if (!ctx.shouldKeepServer()) {
1470
1470
  await ctx.exit();
1471
1471
  }
1472
1472
  } catch (e) {
1473
- const { divider } = await import('./utils.Lot3J_8U.js').then(function (n) { return n.u; });
1474
- console.error(`\n${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
1473
+ const { errorBanner } = await import('./utils.Cc45eY3L.js').then(function (n) { return n.u; });
1474
+ console.error(`\n${errorBanner("Startup Error")}`);
1475
1475
  console.error(e);
1476
1476
  console.error("\n\n");
1477
1477
  if (process.exitCode == null) {
@@ -1493,7 +1493,7 @@ async function collect(mode, cliFilters, options) {
1493
1493
  process.title = "node (vitest)";
1494
1494
  } catch {}
1495
1495
  try {
1496
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.2yb7XCwB.js').then(function (n) { return n.f; });
1496
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.z029PxYZ.js').then(function (n) { return n.f; });
1497
1497
  const ctx = await prepareVitest(mode, {
1498
1498
  ...normalizeCliOptions(cliFilters, options),
1499
1499
  watch: false,
@@ -1515,8 +1515,8 @@ async function collect(mode, cliFilters, options) {
1515
1515
  }
1516
1516
  await ctx.close();
1517
1517
  } catch (e) {
1518
- const { divider } = await import('./utils.Lot3J_8U.js').then(function (n) { return n.u; });
1519
- console.error(`\n${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
1518
+ const { errorBanner } = await import('./utils.Cc45eY3L.js').then(function (n) { return n.u; });
1519
+ console.error(`\n${errorBanner("Collect Error")}`);
1520
1520
  console.error(e);
1521
1521
  console.error("\n\n");
1522
1522
  if (process.exitCode == null) {