vitest 3.0.0 → 3.0.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 (41) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/chunks/{base.CUDzyU2J.js → base.gZAre3Yy.js} +3 -3
  3. package/dist/chunks/{cac.DZC9WjGM.js → cac.CHB7MTUk.js} +22 -22
  4. package/dist/chunks/{cli-api.CmJw5Cd_.js → cli-api.B7hOUwun.js} +164 -131
  5. package/dist/chunks/{console.CN7AiMGV.js → console.BxE0RUCr.js} +3 -3
  6. package/dist/chunks/{creator.DztqrnyH.js → creator.B8v1wNyQ.js} +3 -3
  7. package/dist/chunks/{execute.BMOaRArH.js → execute.4vt3NSmG.js} +3 -4
  8. package/dist/chunks/{globals.C5RQxaV3.js → globals.BSNBk3vE.js} +2 -2
  9. package/dist/chunks/{index.BQbxGbG9.js → index.Bf4FgyZN.js} +1 -1
  10. package/dist/chunks/{index.BJDntFik.js → index.Bh7wTRhh.js} +8 -8
  11. package/dist/chunks/{index.CUcwvygK.js → index.C2XSkjNu.js} +2 -2
  12. package/dist/chunks/{index.D9C26wCk.js → index.DfqWks-F.js} +1 -1
  13. package/dist/chunks/{index.TKSL1HjN.js → index.DyQPL4DO.js} +15 -15
  14. package/dist/chunks/{index.68735LiX.js → index.TH3f4LSA.js} +2 -2
  15. package/dist/chunks/{index.K90BXFOx.js → index.cYxyd29h.js} +12 -12
  16. package/dist/chunks/{inspector.DKLceBVD.js → inspector.CU9GlB9I.js} +1 -1
  17. package/dist/chunks/{resolveConfig.CSLLD33d.js → resolveConfig.DATSOo7x.js} +14 -14
  18. package/dist/chunks/{rpc.TVf73xOu.js → rpc.Bf456uf4.js} +1 -1
  19. package/dist/chunks/{runBaseTests.C0T_TQwH.js → runBaseTests.Ba8jtu6O.js} +8 -8
  20. package/dist/chunks/{setup-common.D0zLenuv.js → setup-common.jLbIuaww.js} +1 -1
  21. package/dist/chunks/{typechecker.BJMkWMXo.js → typechecker.ChNaIV36.js} +9 -9
  22. package/dist/chunks/{vi.Da_PT3Vw.js → vi.CjhMlMwf.js} +6 -6
  23. package/dist/chunks/{vm.DrFVeTXo.js → vm.CUw7ChSp.js} +5 -5
  24. package/dist/cli.js +1 -1
  25. package/dist/config.cjs +1 -1
  26. package/dist/config.js +1 -1
  27. package/dist/coverage.js +9 -9
  28. package/dist/environments.js +1 -1
  29. package/dist/execute.js +1 -1
  30. package/dist/index.js +2 -2
  31. package/dist/node.js +9 -9
  32. package/dist/reporters.js +2 -2
  33. package/dist/runners.js +4 -4
  34. package/dist/worker.js +5 -5
  35. package/dist/workers/forks.js +2 -2
  36. package/dist/workers/runVmTests.js +7 -7
  37. package/dist/workers/threads.js +2 -2
  38. package/dist/workers/vmForks.js +3 -3
  39. package/dist/workers/vmThreads.js +3 -3
  40. package/dist/workers.js +8 -8
  41. package/package.json +15 -15
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.BWeNbfBa.js';
2
2
  export { s as SpyModule } from './chunks/spy.Cf_4R5Oe.js';
3
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.D0zLenuv.js';
3
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.jLbIuaww.js';
4
4
  export { collectTests, processError, startTests } from '@vitest/runner';
5
5
  import '@vitest/spy';
6
6
  import '@vitest/snapshot';
@@ -1,5 +1,5 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BMOaRArH.js';
2
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.4vt3NSmG.js';
3
3
  import { p as provideWorkerState } from './utils.C8RiOc4B.js';
4
4
 
5
5
  let _viteNode;
@@ -26,10 +26,10 @@ async function runBaseTests(method, state) {
26
26
  ));
27
27
  const [executor, { run }] = await Promise.all([
28
28
  startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
29
- import('./runBaseTests.C0T_TQwH.js')
29
+ import('./runBaseTests.Ba8jtu6O.js')
30
30
  ]);
31
31
  const fileSpecs = ctx.files.map(
32
- (f) => typeof f === "string" ? { filepath: f, testLocations: void 0 } : f
32
+ (f) => typeof f === "string" ? { filepath: f, testLocations: undefined } : f
33
33
  );
34
34
  await run(
35
35
  method,
@@ -25,9 +25,9 @@ function mri2 (args, opts) {
25
25
  var k, arr, arg, name, val, out={ _:[] };
26
26
  var i=0, j=0, idx=0, len=args.length;
27
27
 
28
- const alibi = opts.alias !== void 0;
29
- const strict = opts.unknown !== void 0;
30
- const defaults = opts.default !== void 0;
28
+ const alibi = opts.alias !== undefined;
29
+ const strict = opts.unknown !== undefined;
30
+ const defaults = opts.default !== undefined;
31
31
 
32
32
  opts.alias = opts.alias || {};
33
33
  opts.string = toArr(opts.string);
@@ -56,7 +56,7 @@ function mri2 (args, opts) {
56
56
  for (k in opts.default) {
57
57
  name = typeof opts.default[k];
58
58
  arr = opts.alias[k] = opts.alias[k] || [];
59
- if (opts[name] !== void 0) {
59
+ if (opts[name] !== undefined) {
60
60
  opts[name].push(k);
61
61
  for (i=0; i < arr.length; i++) {
62
62
  opts[name].push(arr[i]);
@@ -106,7 +106,7 @@ function mri2 (args, opts) {
106
106
 
107
107
  if (defaults) {
108
108
  for (k in opts.default) {
109
- if (out[k] === void 0) {
109
+ if (out[k] === undefined) {
110
110
  out[k] = opts.default[k];
111
111
  }
112
112
  }
@@ -359,7 +359,7 @@ class Command {
359
359
  sections.push({
360
360
  title: "Options",
361
361
  body: options.map((option) => {
362
- return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
362
+ return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? "" : `(default: ${option.config.default})`}`;
363
363
  }).join("\n")
364
364
  });
365
365
  }
@@ -492,8 +492,8 @@ class CAC extends EventEmitter {
492
492
  return this;
493
493
  }
494
494
  unsetMatchedCommand() {
495
- this.matchedCommand = void 0;
496
- this.matchedCommandName = void 0;
495
+ this.matchedCommand = undefined;
496
+ this.matchedCommandName = undefined;
497
497
  }
498
498
  parse(argv = processArgs, {
499
499
  run = true
@@ -573,13 +573,13 @@ class CAC extends EventEmitter {
573
573
  const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
574
574
  let transforms = Object.create(null);
575
575
  for (const cliOption of cliOptions) {
576
- if (!ignoreDefault && cliOption.config.default !== void 0) {
576
+ if (!ignoreDefault && cliOption.config.default !== undefined) {
577
577
  for (const name of cliOption.names) {
578
578
  options[name] = cliOption.config.default;
579
579
  }
580
580
  }
581
581
  if (cliOption.config.type != null) {
582
- if (transforms[cliOption.name] === void 0) {
582
+ if (transforms[cliOption.name] === undefined) {
583
583
  transforms[cliOption.name] = cliOption.config.type;
584
584
  }
585
585
  }
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
618
618
 
619
619
  const cac = (name = "") => new CAC(name);
620
620
 
621
- var version = "3.0.0";
621
+ var version = "3.0.2";
622
622
 
623
623
  const apiConfig = (port) => ({
624
624
  port: {
@@ -1486,20 +1486,20 @@ function createCLI(options = {}) {
1486
1486
  }
1487
1487
  return info;
1488
1488
  });
1489
- cli.command("run [...filters]", void 0, options).action(run);
1490
- cli.command("related [...filters]", void 0, options).action(runRelated);
1491
- cli.command("watch [...filters]", void 0, options).action(watch);
1492
- cli.command("dev [...filters]", void 0, options).action(watch);
1489
+ cli.command("run [...filters]", undefined, options).action(run);
1490
+ cli.command("related [...filters]", undefined, options).action(runRelated);
1491
+ cli.command("watch [...filters]", undefined, options).action(watch);
1492
+ cli.command("dev [...filters]", undefined, options).action(watch);
1493
1493
  addCliOptions(
1494
- cli.command("bench [...filters]", void 0, options).action(benchmark),
1494
+ cli.command("bench [...filters]", undefined, options).action(benchmark),
1495
1495
  benchCliOptionsConfig
1496
1496
  );
1497
- cli.command("init <project>", void 0, options).action(init);
1497
+ cli.command("init <project>", undefined, options).action(init);
1498
1498
  addCliOptions(
1499
- cli.command("list [...filters]", void 0, options).action((filters, options2) => collect("test", filters, options2)),
1499
+ cli.command("list [...filters]", undefined, options).action((filters, options2) => collect("test", filters, options2)),
1500
1500
  collectCliOptionsConfig
1501
1501
  );
1502
- cli.command("[...filters]", void 0, options).action((filters, options2) => start("test", filters, options2));
1502
+ cli.command("[...filters]", undefined, options).action((filters, options2) => start("test", filters, options2));
1503
1503
  return cli;
1504
1504
  }
1505
1505
  function parseCLI(argv, config = {}) {
@@ -1567,7 +1567,7 @@ async function start(mode, cliFilters, options) {
1567
1567
  } catch {
1568
1568
  }
1569
1569
  try {
1570
- const { startVitest } = await import('./cli-api.CmJw5Cd_.js').then(function (n) { return n.f; });
1570
+ const { startVitest } = await import('./cli-api.B7hOUwun.js').then(function (n) { return n.f; });
1571
1571
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1572
1572
  if (!ctx.shouldKeepServer()) {
1573
1573
  await ctx.exit();
@@ -1589,7 +1589,7 @@ async function init(project) {
1589
1589
  console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
1590
1590
  process.exit(1);
1591
1591
  }
1592
- const { create } = await import('./creator.DztqrnyH.js');
1592
+ const { create } = await import('./creator.B8v1wNyQ.js');
1593
1593
  await create();
1594
1594
  }
1595
1595
  async function collect(mode, cliFilters, options) {
@@ -1598,7 +1598,7 @@ async function collect(mode, cliFilters, options) {
1598
1598
  } catch {
1599
1599
  }
1600
1600
  try {
1601
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.CmJw5Cd_.js').then(function (n) { return n.f; });
1601
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.B7hOUwun.js').then(function (n) { return n.f; });
1602
1602
  const ctx = await prepareVitest(mode, {
1603
1603
  ...normalizeCliOptions(cliFilters, options),
1604
1604
  watch: false,