vitest 4.0.0-beta.11 → 4.0.0-beta.13

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 (55) hide show
  1. package/LICENSE.md +4 -101
  2. package/dist/browser.d.ts +3 -3
  3. package/dist/browser.js +2 -2
  4. package/dist/chunks/{benchmark.LXhJ0F0X.js → benchmark.DHKMYAts.js} +1 -1
  5. package/dist/chunks/{browser.d.Dx7DO_Ce.d.ts → browser.d.D9YV3JvA.d.ts} +1 -1
  6. package/dist/chunks/{cac.elvK37c9.js → cac.BBtYKH7y.js} +16 -9
  7. package/dist/chunks/{cli-api.C7plPyhs.js → cli-api.CeakdBUN.js} +95 -148
  8. package/dist/chunks/{config.d.B_LthbQq.d.ts → config.d.DGazh2r6.d.ts} +3 -1
  9. package/dist/chunks/{console.CiTi59Jy.js → console.CTJL2nuH.js} +3 -5
  10. package/dist/chunks/{coverage.CG6Uhorw.js → coverage.DabP7UTQ.js} +69 -80
  11. package/dist/chunks/{creator.08Gi-vCA.js → creator.DfXDsUyL.js} +6 -8
  12. package/dist/chunks/{global.d.BK3X7FW1.d.ts → global.d.BcFPD2LN.d.ts} +0 -13
  13. package/dist/chunks/{globals.BjvYA-AD.js → globals.DC4ntO86.js} +5 -5
  14. package/dist/chunks/{index.DIWhzsUh.js → index.Bt-upxGS.js} +6 -12
  15. package/dist/chunks/{index.BwBttQPf.js → index.CHrBLuEH.js} +33 -38
  16. package/dist/chunks/{index.X0nbfr6-.js → index.Dc3xnDvT.js} +48 -289
  17. package/dist/chunks/{index.AZOjjqWP.js → index.Dnl38iQ_.js} +2 -2
  18. package/dist/chunks/{index.BhY64fF0.js → index.uLUz1RDt.js} +1 -1
  19. package/dist/chunks/{inspector.CvQD-Nie.js → inspector.Br76Q2Mb.js} +1 -4
  20. package/dist/chunks/{moduleRunner.d.BNa-CL9e.d.ts → moduleRunner.d.CeYc7nZ0.d.ts} +1 -1
  21. package/dist/chunks/{node.BsdMi6DV.js → node.BwAWWjHZ.js} +2 -3
  22. package/dist/chunks/{plugin.d.C5phQR6o.d.ts → plugin.d.COyglhiI.d.ts} +1 -1
  23. package/dist/chunks/{reporters.d.CVzhsTvK.d.ts → reporters.d.xGvTJYG3.d.ts} +41 -4
  24. package/dist/chunks/{resolveSnapshotEnvironment.DQVamkje.js → resolveSnapshotEnvironment.BsJpmVZR.js} +7 -8
  25. package/dist/chunks/{rpc.jKGRSXIH.js → rpc.cD77ENhU.js} +12 -13
  26. package/dist/chunks/{setup-common.NAWRuMRP.js → setup-common.BewgbkTd.js} +5 -5
  27. package/dist/chunks/{startModuleRunner.oAuCu1yL.js → startModuleRunner.DPBo3mme.js} +40 -48
  28. package/dist/chunks/{test.KC5tH8hC.js → test.CTuWuHYH.js} +5 -5
  29. package/dist/chunks/{typechecker.gXq-5P3n.js → typechecker.BfOQ86_a.js} +54 -77
  30. package/dist/chunks/{utils.DGKhod2J.js → utils.CG9h5ccR.js} +1 -4
  31. package/dist/chunks/{vi.CiJ0Laa6.js → vi.B2--mG9U.js} +35 -144
  32. package/dist/chunks/{worker.rPGLlbkW.js → worker.DVTUM2IW.js} +11 -15
  33. package/dist/chunks/{worker.d.B_Fd9M_w.d.ts → worker.d.buwuBpBt.d.ts} +1 -1
  34. package/dist/cli.js +3 -3
  35. package/dist/config.d.ts +6 -6
  36. package/dist/coverage.d.ts +5 -5
  37. package/dist/coverage.js +3 -3
  38. package/dist/environments.js +1 -1
  39. package/dist/index.d.ts +8 -8
  40. package/dist/index.js +5 -5
  41. package/dist/module-evaluator.d.ts +3 -3
  42. package/dist/module-evaluator.js +10 -12
  43. package/dist/module-runner.js +2 -2
  44. package/dist/node.d.ts +8 -8
  45. package/dist/node.js +10 -10
  46. package/dist/reporters.d.ts +5 -5
  47. package/dist/reporters.js +3 -3
  48. package/dist/runners.d.ts +1 -1
  49. package/dist/runners.js +6 -6
  50. package/dist/snapshot.js +2 -2
  51. package/dist/suite.js +2 -2
  52. package/dist/worker-base.js +30 -32
  53. package/dist/worker-vm.js +19 -30
  54. package/dist/workers/runVmTests.js +10 -10
  55. package/package.json +18 -19
package/LICENSE.md CHANGED
@@ -280,43 +280,14 @@ Repository: egoist/cac
280
280
 
281
281
  ---------------------------------------
282
282
 
283
- ## chai-subset
283
+ ## empathic
284
284
  License: MIT
285
- By: Andrii Shumada, Robert Herhold
286
- Repository: https://github.com/debitoor/chai-subset.git
287
-
288
- > The MIT License (MIT)
289
- >
290
- > Copyright (c) 2014
291
- >
292
- > Permission is hereby granted, free of charge, to any person obtaining a copy
293
- > of this software and associated documentation files (the "Software"), to deal
294
- > in the Software without restriction, including without limitation the rights
295
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
296
- > copies of the Software, and to permit persons to whom the Software is
297
- > furnished to do so, subject to the following conditions:
298
- >
299
- > The above copyright notice and this permission notice shall be included in all
300
- > copies or substantial portions of the Software.
301
- >
302
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
303
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
304
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
305
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
306
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
307
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
308
- > SOFTWARE.
309
-
310
- ---------------------------------------
311
-
312
- ## find-up
313
- License: MIT
314
- By: Sindre Sorhus
315
- Repository: sindresorhus/find-up
285
+ By: Luke Edwards
286
+ Repository: lukeed/empathic
316
287
 
317
288
  > MIT License
318
289
  >
319
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
290
+ > Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
320
291
  >
321
292
  > 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:
322
293
  >
@@ -436,23 +407,6 @@ Repository: git+https://github.com/antfu-collective/local-pkg.git
436
407
 
437
408
  ---------------------------------------
438
409
 
439
- ## locate-path
440
- License: MIT
441
- By: Sindre Sorhus
442
- Repository: sindresorhus/locate-path
443
-
444
- > MIT License
445
- >
446
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
447
- >
448
- > 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:
449
- >
450
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
451
- >
452
- > 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.
453
-
454
- ---------------------------------------
455
-
456
410
  ## mime
457
411
  License: MIT
458
412
  By: Robert Kieffer
@@ -510,40 +464,6 @@ Repository: unjs/mlly
510
464
 
511
465
  ---------------------------------------
512
466
 
513
- ## p-limit
514
- License: MIT
515
- By: Sindre Sorhus
516
- Repository: sindresorhus/p-limit
517
-
518
- > MIT License
519
- >
520
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
521
- >
522
- > 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:
523
- >
524
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
525
- >
526
- > 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.
527
-
528
- ---------------------------------------
529
-
530
- ## p-locate
531
- License: MIT
532
- By: Sindre Sorhus
533
- Repository: sindresorhus/p-locate
534
-
535
- > MIT License
536
- >
537
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
538
- >
539
- > 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:
540
- >
541
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
542
- >
543
- > 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.
544
-
545
- ---------------------------------------
546
-
547
467
  ## package-manager-detector
548
468
  License: MIT
549
469
  By: Anthony Fu
@@ -769,20 +689,3 @@ Repository: git+https://github.com/websockets/ws.git
769
689
  > COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
770
690
  > IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
771
691
  > CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
772
-
773
- ---------------------------------------
774
-
775
- ## yocto-queue
776
- License: MIT
777
- By: Sindre Sorhus
778
- Repository: sindresorhus/yocto-queue
779
-
780
- > MIT License
781
- >
782
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
783
- >
784
- > 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:
785
- >
786
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
787
- >
788
- > 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.
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.B_LthbQq.js';
1
+ import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.DGazh2r6.js';
2
2
  import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
3
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
4
- import { V as VitestModuleRunner } from './chunks/moduleRunner.d.BNa-CL9e.js';
4
+ import { V as VitestModuleRunner } from './chunks/moduleRunner.d.CeYc7nZ0.js';
5
5
  export { collectTests, startTests } from '@vitest/runner';
6
6
  import * as _vitest_spy from '@vitest/spy';
7
7
  export { _vitest_spy as SpyModule };
@@ -15,7 +15,7 @@ import '@vitest/pretty-format';
15
15
  import '@vitest/snapshot';
16
16
  import 'node:vm';
17
17
  import 'vite/module-runner';
18
- import './chunks/worker.d.B_Fd9M_w.js';
18
+ import './chunks/worker.d.buwuBpBt.js';
19
19
  import './chunks/environment.d.BsToaxti.js';
20
20
  import '@vitest/mocker';
21
21
  import './chunks/mocker.d.BE_2ls6u.js';
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.NAWRuMRP.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.BewgbkTd.js';
2
2
  export { collectTests, startTests } from '@vitest/runner';
3
3
  import * as spyModule from '@vitest/spy';
4
4
  export { spyModule as SpyModule };
@@ -9,4 +9,4 @@ export { DecodedMap, getOriginalPosition } from '@vitest/utils/source-map';
9
9
  export { getSafeTimers, setSafeTimers } from '@vitest/utils/timers';
10
10
  import './chunks/coverage.D_JHT54q.js';
11
11
  import '@vitest/snapshot';
12
- import './chunks/utils.DGKhod2J.js';
12
+ import './chunks/utils.CG9h5ccR.js';
@@ -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/helpers';
4
- import { g as getWorkerState } from './utils.DGKhod2J.js';
4
+ import { g as getWorkerState } from './utils.CG9h5ccR.js';
5
5
 
6
6
  const benchFns = /* @__PURE__ */ new WeakMap(), benchOptsMap = /* @__PURE__ */ new WeakMap();
7
7
  function getBenchOptions(key) {
@@ -1,4 +1,4 @@
1
- import { T as TestExecutionMethod } from './worker.d.B_Fd9M_w.js';
1
+ import { T as TestExecutionMethod } from './worker.d.buwuBpBt.js';
2
2
 
3
3
  type SerializedTestSpecification = [project: {
4
4
  name: string | undefined;
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import { normalize } from 'pathe';
4
4
  import c from 'tinyrainbow';
5
5
  import { a as defaultPort, d as defaultBrowserPort } from './constants.D_Q9UYh-.js';
6
- import { R as ReportersMap } from './index.BwBttQPf.js';
6
+ import { R as ReportersMap } from './index.CHrBLuEH.js';
7
7
 
8
8
  function toArr(any) {
9
9
  return any == null ? [] : Array.isArray(any) ? any : [any];
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
619
619
 
620
620
  const cac = (name = "") => new CAC(name);
621
621
 
622
- var version = "4.0.0-beta.11";
622
+ var version = "4.0.0-beta.13";
623
623
 
624
624
  const apiConfig = (port) => ({
625
625
  port: {
@@ -877,6 +877,14 @@ const cliOptionsConfig = {
877
877
  argument: "<timeout>"
878
878
  },
879
879
  trackUnhandledErrors: { description: "Control if Vitest catches uncaught exceptions so they can be reported (default: `true`)" },
880
+ trace: {
881
+ description: "Enable trace view mode. Supported: \"on\", \"off\", \"on-first-retry\", \"on-all-retries\", \"retain-on-failure\".",
882
+ argument: "<mode>",
883
+ subcommands: null,
884
+ transform(value) {
885
+ return { mode: value };
886
+ }
887
+ },
880
888
  orchestratorScripts: null,
881
889
  commands: null,
882
890
  viewport: null,
@@ -1296,8 +1304,7 @@ function removeQuotes(str) {
1296
1304
  return typeof str === "string" ? str[0] === "\"" && str.endsWith("\"") || str.startsWith(`'`) && str.endsWith(`'`) ? str.slice(1, -1) : str : Array.isArray(str) ? str.map(removeQuotes) : str;
1297
1305
  }
1298
1306
  function splitArgv(argv) {
1299
- const reg = /(['"])(?:(?!\1).)+\1/g;
1300
- return argv = argv.replace(reg, (match) => match.replace(/\s/g, "\0")), argv.split(" ").map((arg) => {
1307
+ return argv = argv.replace(/(['"])(?:(?!\1).)+\1/g, (match) => match.replace(/\s/g, "\0")), argv.split(" ").map((arg) => {
1301
1308
  return arg = arg.replace(/\0/g, " "), removeQuotes(arg);
1302
1309
  });
1303
1310
  }
@@ -1334,22 +1341,22 @@ function normalizeCliOptions(cliFilters, argv) {
1334
1341
  }
1335
1342
  async function start(mode, cliFilters, options) {
1336
1343
  try {
1337
- const { startVitest } = await import('./cli-api.C7plPyhs.js').then(function (n) { return n.j; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1344
+ const { startVitest } = await import('./cli-api.CeakdBUN.js').then(function (n) { return n.j; }), ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1338
1345
  if (!ctx.shouldKeepServer()) await ctx.exit();
1339
1346
  } catch (e) {
1340
- const { errorBanner } = await import('./index.BwBttQPf.js').then(function (n) { return n.u; });
1347
+ const { errorBanner } = await import('./index.CHrBLuEH.js').then(function (n) { return n.u; });
1341
1348
  if (console.error(`\n${errorBanner("Startup Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
1342
1349
  process.exit();
1343
1350
  }
1344
1351
  }
1345
1352
  async function init(project) {
1346
1353
  if (project !== "browser") console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project.")), process.exit(1);
1347
- const { create } = await import('./creator.08Gi-vCA.js');
1354
+ const { create } = await import('./creator.DfXDsUyL.js');
1348
1355
  await create();
1349
1356
  }
1350
1357
  async function collect(mode, cliFilters, options) {
1351
1358
  try {
1352
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.C7plPyhs.js').then(function (n) { return n.j; }), ctx = await prepareVitest(mode, {
1359
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.CeakdBUN.js').then(function (n) { return n.j; }), ctx = await prepareVitest(mode, {
1353
1360
  ...normalizeCliOptions(cliFilters, options),
1354
1361
  watch: false,
1355
1362
  run: true
@@ -1367,7 +1374,7 @@ async function collect(mode, cliFilters, options) {
1367
1374
  }
1368
1375
  await ctx.close();
1369
1376
  } catch (e) {
1370
- const { errorBanner } = await import('./index.BwBttQPf.js').then(function (n) { return n.u; });
1377
+ const { errorBanner } = await import('./index.CHrBLuEH.js').then(function (n) { return n.u; });
1371
1378
  if (console.error(`\n${errorBanner("Collect Error")}`), console.error(e), console.error("\n\n"), process.exitCode == null) process.exitCode = 1;
1372
1379
  process.exit();
1373
1380
  }