vitest 3.0.4 → 3.0.6

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 (59) hide show
  1. package/LICENSE.md +20 -304
  2. package/dist/browser.d.ts +8 -14
  3. package/dist/browser.js +2 -2
  4. package/dist/chunks/{base.wKnmhRYd.js → base.B2NLWv2w.js} +5 -3
  5. package/dist/chunks/{cac.DYBkNWP6.js → cac.mNJBJcT7.js} +24 -24
  6. package/dist/chunks/{cli-api.Ci-9Ccnz.js → cli-api.Dkt_XoKq.js} +3289 -3054
  7. package/dist/chunks/{console.BxE0RUCr.js → console.CN7AiMGV.js} +3 -3
  8. package/dist/chunks/{coverage.BWeNbfBa.js → coverage.DnNIv-kJ.js} +1 -1
  9. package/dist/chunks/{creator.fUJbheb8.js → creator.2CFRE1Yx.js} +5 -5
  10. package/dist/chunks/{execute.PoofJYS5.js → execute.DNQad00_.js} +11 -4
  11. package/dist/chunks/{globals.BSNBk3vE.js → globals.DrEiwfS1.js} +2 -2
  12. package/dist/chunks/{index.TH3f4LSA.js → index.68735LiX.js} +2 -2
  13. package/dist/chunks/{index.NxxmQyK2.js → index.Bw6JxgX8.js} +3 -3
  14. package/dist/chunks/{index.vId0fl99.js → index.C1f-_gvH.js} +86 -45
  15. package/dist/chunks/{index.B57_6XMC.js → index.DBIGubLC.js} +8 -8
  16. package/dist/chunks/{index.C2XSkjNu.js → index.DC3HGwr0.js} +3 -3
  17. package/dist/chunks/{index.cYxyd29h.js → index.K90BXFOx.js} +12 -12
  18. package/dist/chunks/{index.Bf4FgyZN.js → index.SduP00mx.js} +1 -1
  19. package/dist/chunks/{inspector.CU9GlB9I.js → inspector.DKLceBVD.js} +1 -1
  20. package/dist/chunks/{reporters.0x019-V2.d.ts → reporters.DTtkbAtP.d.ts} +78 -60
  21. package/dist/chunks/{resolveConfig.DkmB2h7h.js → resolveConfig.BbcK25zb.js} +23 -24
  22. package/dist/chunks/{rpc.Bf456uf4.js → rpc.TVf73xOu.js} +1 -1
  23. package/dist/chunks/{runBaseTests.Ba8jtu6O.js → runBaseTests.Cr-AyqFv.js} +9 -9
  24. package/dist/chunks/{setup-common.jLbIuaww.js → setup-common.IrcyRZ8C.js} +1 -1
  25. package/dist/chunks/{suite.BJU7kdY9.d.ts → suite.qtkXWc6R.d.ts} +1 -1
  26. package/dist/chunks/{typechecker.CdcjdhoT.js → typechecker.cZ0LjdSi.js} +7 -7
  27. package/dist/chunks/{utils.DJWL04yX.js → utils.bLM2atbD.js} +3 -3
  28. package/dist/chunks/{vi.CjhMlMwf.js → vi.DrftpPF8.js} +26 -20
  29. package/dist/chunks/{vite.DiG-KbRF.d.ts → vite.BmCIRnbq.d.ts} +1 -1
  30. package/dist/chunks/{vm.DXDoSHPT.js → vm.ku9l48hv.js} +7 -5
  31. package/dist/chunks/{worker.B1y96qmv.d.ts → worker.B2JXutr8.d.ts} +1 -1
  32. package/dist/chunks/{worker.CIpff8Eg.d.ts → worker.DaAIyCKm.d.ts} +2 -1
  33. package/dist/cli.js +1 -1
  34. package/dist/config.cjs +3 -4
  35. package/dist/config.d.ts +23 -26
  36. package/dist/config.js +3 -4
  37. package/dist/coverage.d.ts +3 -3
  38. package/dist/coverage.js +10 -10
  39. package/dist/environments.d.ts +2 -2
  40. package/dist/environments.js +1 -1
  41. package/dist/execute.d.ts +6 -6
  42. package/dist/execute.js +1 -1
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +2 -2
  45. package/dist/node.d.ts +16 -13
  46. package/dist/node.js +12 -13
  47. package/dist/reporters.d.ts +1 -1
  48. package/dist/reporters.js +3 -3
  49. package/dist/runners.js +4 -4
  50. package/dist/suite.d.ts +1 -1
  51. package/dist/worker.js +6 -5
  52. package/dist/workers/forks.js +4 -4
  53. package/dist/workers/runVmTests.js +8 -8
  54. package/dist/workers/threads.js +4 -4
  55. package/dist/workers/vmForks.js +5 -5
  56. package/dist/workers/vmThreads.js +5 -5
  57. package/dist/workers.d.ts +2 -2
  58. package/dist/workers.js +8 -8
  59. package/package.json +18 -18
@@ -121,7 +121,7 @@ function createCustomConsole(defaultState) {
121
121
  Error.stackTraceLimit = limit;
122
122
  buffer.push([data, trace]);
123
123
  } else {
124
- buffer.push([data, undefined]);
124
+ buffer.push([data, void 0]);
125
125
  }
126
126
  schedule(id);
127
127
  callback();
@@ -155,14 +155,14 @@ function createCustomConsole(defaultState) {
155
155
  (line) => line.includes("at Console.trace")
156
156
  );
157
157
  if (isTrace) {
158
- buffer.push([data, undefined]);
158
+ buffer.push([data, void 0]);
159
159
  } else {
160
160
  const trace = stack?.slice(7).join("\n");
161
161
  Error.stackTraceLimit = limit;
162
162
  buffer.push([data, trace]);
163
163
  }
164
164
  } else {
165
- buffer.push([data, undefined]);
165
+ buffer.push([data, void 0]);
166
166
  }
167
167
  schedule(id);
168
168
  callback();
@@ -53,7 +53,7 @@ async function startCoverageInsideWorker(options, loader, runtimeOptions) {
53
53
  async function takeCoverageInsideWorker(options, loader) {
54
54
  const coverageModule = await resolveCoverageProviderModule(options, loader);
55
55
  if (coverageModule) {
56
- return coverageModule.takeCoverage?.();
56
+ return coverageModule.takeCoverage?.({ moduleExecutionInfo: loader.moduleExecutionInfo });
57
57
  }
58
58
  return null;
59
59
  }
@@ -1,8 +1,8 @@
1
1
  import { existsSync, writeFileSync, readFileSync } from 'node:fs';
2
2
  import { mkdir, writeFile } from 'node:fs/promises';
3
3
  import { resolve, dirname, relative } from 'node:path';
4
- import { detectPackageManager, installPackage } from './index.NxxmQyK2.js';
5
- import { p as prompt, f as findUp } from './index.B57_6XMC.js';
4
+ import { detectPackageManager, installPackage } from './index.Bw6JxgX8.js';
5
+ import { p as prompt, f as findUp } from './index.DBIGubLC.js';
6
6
  import { x } from 'tinyexec';
7
7
  import c from 'tinyrainbow';
8
8
  import { c as configFiles } from './constants.fzPh7AOq.js';
@@ -373,7 +373,7 @@ async function installPackages(pkgManager, packages) {
373
373
  log(c.cyan("\u25FC"), c.bold("Installing packages..."));
374
374
  log(c.cyan("\u25FC"), packages.join(", "));
375
375
  log();
376
- await installPackage(packages, { dev: true, packageManager: pkgManager ?? undefined });
376
+ await installPackage(packages, { dev: true, packageManager: pkgManager ?? void 0 });
377
377
  }
378
378
  function readPkgJson(path) {
379
379
  if (!existsSync(path)) {
@@ -452,7 +452,7 @@ async function generateWorkspaceFile(options) {
452
452
  ` enabled: true,`,
453
453
  ` provider: '${options.provider}',`,
454
454
  options.provider !== "preview" && ` // ${getProviderDocsLink(options.provider)}`,
455
- ` configs: [`,
455
+ ` instances: [`,
456
456
  ...options.browsers.map((browser) => ` { browser: '${browser}' },`),
457
457
  ` ],`,
458
458
  ` },`,
@@ -476,7 +476,7 @@ async function generateFrameworkConfigFile(options) {
476
476
  ` enabled: true,`,
477
477
  ` provider: '${options.provider}',`,
478
478
  options.provider !== "preview" && ` // ${getProviderDocsLink(options.provider)}`,
479
- ` configs: [`,
479
+ ` instances: [`,
480
480
  ...options.browsers.map((browser) => ` { browser: '${browser}' },`),
481
481
  ` ],`,
482
482
  ` },`,
@@ -4,7 +4,7 @@ import vm from 'node:vm';
4
4
  import { processError } from '@vitest/utils/error';
5
5
  import { normalize as normalize$1, relative } from 'pathe';
6
6
  import { ViteNodeRunner, DEFAULT_REQUEST_STUBS } from 'vite-node/client';
7
- import { isInternalRequest, isNodeBuiltin as isNodeBuiltin$1, toFilePath, isPrimitive } from 'vite-node/utils';
7
+ import { isInternalRequest, isNodeBuiltin as isNodeBuiltin$1, isPrimitive, toFilePath } from 'vite-node/utils';
8
8
  import { distDir } from '../path.js';
9
9
  import { resolve as resolve$1, isAbsolute as isAbsolute$1 } from 'node:path';
10
10
  import { MockerRegistry, mockObject, RedirectedModule, AutomockedModule } from '@vitest/mocker';
@@ -395,7 +395,7 @@ class VitestMocker {
395
395
  }
396
396
  } else if (!(prop in target)) {
397
397
  if (this.filterPublicKeys.includes(prop)) {
398
- return undefined;
398
+ return void 0;
399
399
  }
400
400
  throw this.createError(
401
401
  `[vitest] No "${String(prop)}" export is defined on the "${mock.raw}" mock. Did you forget to return it from "vi.mock"?
@@ -538,7 +538,7 @@ If you need to partially mock a module, you can use "importOriginal" helper insi
538
538
  action: "mock",
539
539
  id,
540
540
  importer,
541
- factory: typeof factoryOrOptions === "function" ? factoryOrOptions : undefined,
541
+ factory: typeof factoryOrOptions === "function" ? factoryOrOptions : void 0,
542
542
  type: mockType
543
543
  });
544
544
  }
@@ -642,6 +642,9 @@ async function startVitestExecutor(options) {
642
642
  get moduleCache() {
643
643
  return state().moduleCache;
644
644
  },
645
+ get moduleExecutionInfo() {
646
+ return state().moduleExecutionInfo;
647
+ },
645
648
  get interopDefault() {
646
649
  return state().config.deps.interopDefault;
647
650
  },
@@ -740,6 +743,9 @@ class VitestExecutor extends ViteNodeRunner {
740
743
  get state() {
741
744
  return globalThis.__vitest_worker__ || this.options.state;
742
745
  }
746
+ get moduleExecutionInfo() {
747
+ return this.options.moduleExecutionInfo;
748
+ }
743
749
  shouldResolveId(id, _importee) {
744
750
  if (isInternalRequest(id) || id.startsWith("data:")) {
745
751
  return false;
@@ -764,7 +770,7 @@ class VitestExecutor extends ViteNodeRunner {
764
770
  const { id: id2 } = error[Symbol.for("vitest.error.not_found.data")];
765
771
  const path = this.mocker.normalizePath(id2);
766
772
  const mock = this.mocker.getDependencyMock(path);
767
- if (mock !== undefined) {
773
+ if (mock !== void 0) {
768
774
  return [id2, id2];
769
775
  }
770
776
  }
@@ -786,6 +792,7 @@ class VitestExecutor extends ViteNodeRunner {
786
792
  lineOffset: 0,
787
793
  columnOffset: -codeDefinition.length
788
794
  };
795
+ this.options.moduleExecutionInfo?.set(options.filename, { startOffset: codeDefinition.length });
789
796
  const fn = vm.runInContext(code, vmContext, {
790
797
  ...options,
791
798
  // if we encountered an import, it's not inlined
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.fzPh7AOq.js';
2
- import { V as VitestIndex } from './index.Bf4FgyZN.js';
3
- import './vi.CjhMlMwf.js';
2
+ import { V as VitestIndex } from './index.SduP00mx.js';
3
+ import './vi.DrftpPF8.js';
4
4
  import '@vitest/expect';
5
5
  import '@vitest/runner';
6
6
  import '@vitest/runner/utils';
@@ -28,7 +28,7 @@ function createBirpc(functions, options) {
28
28
  if (method === "$close")
29
29
  return close;
30
30
  if (method === "then" && !eventNames.includes("then") && !("then" in functions))
31
- return undefined;
31
+ return void 0;
32
32
  const sendEvent = (...args) => {
33
33
  post(serialize({ m: method, a: args, t: "q" }));
34
34
  };
@@ -43,7 +43,7 @@ function createBirpc(functions, options) {
43
43
  try {
44
44
  await _promise;
45
45
  } finally {
46
- _promise = undefined;
46
+ _promise = void 0;
47
47
  }
48
48
  }
49
49
  return new Promise((resolve, reject) => {
@@ -1,6 +1,6 @@
1
1
  import process from 'node:process';
2
2
  import fs, { existsSync } from 'node:fs';
3
- import fsp from 'node:fs/promises';
3
+ import fsPromises from 'node:fs/promises';
4
4
  import p, { resolve } from 'node:path';
5
5
  import { x } from 'tinyexec';
6
6
 
@@ -80,7 +80,7 @@ function handlePackageManager(filepath, onUnknown) {
80
80
  }
81
81
  async function fileExists(filePath) {
82
82
  try {
83
- const stats = await fsp.stat(filePath);
83
+ const stats = await fsPromises.stat(filePath);
84
84
  if (stats.isFile()) {
85
85
  return true;
86
86
  }
@@ -95,7 +95,7 @@ async function detectPackageManager(cwd = process.cwd()) {
95
95
  cwd,
96
96
  onUnknown(packageManager) {
97
97
  console.warn("[@antfu/install-pkg] Unknown packageManager:", packageManager);
98
- return undefined;
98
+ return void 0;
99
99
  }
100
100
  });
101
101
  return result?.agent || null;
@@ -1,14 +1,14 @@
1
1
  import fs, { existsSync, readFileSync, promises } from 'node:fs';
2
- import { getTests, getTestName, hasFailed, getFullName, getSuites, getTasks } from '@vitest/runner/utils';
2
+ import { getSuites, getTests, getTestName, hasFailed, getFullName, getTasks } from '@vitest/runner/utils';
3
3
  import * as pathe from 'pathe';
4
4
  import { relative, normalize, resolve, dirname } from 'pathe';
5
5
  import c from 'tinyrainbow';
6
- import { d as divider, F as F_POINTER, t as truncateString, f as formatTimeString, g as getStateSymbol, a as formatProjectName, b as taskFail, c as F_RIGHT, e as F_CHECK, w as withLabel, r as renderSnapshotSummary, p as padSummaryTitle, h as getStateString$1, i as formatTime, j as countTestErrors, k as F_TREE_NODE_END, l as F_TREE_NODE_MIDDLE } from './utils.DJWL04yX.js';
6
+ import { t as truncateString, d as divider, F as F_POINTER, f as formatTimeString, g as getStateSymbol, a as formatProjectName, b as taskFail, c as F_CHECK, e as F_RIGHT, w as withLabel, r as renderSnapshotSummary, p as padSummaryTitle, h as getStateString$1, i as formatTime, j as countTestErrors, k as F_TREE_NODE_END, l as F_TREE_NODE_MIDDLE } from './utils.bLM2atbD.js';
7
7
  import { stripVTControlCharacters } from 'node:util';
8
- import { isPrimitive, inspect, positionToOffset, lineSplitRE, toArray, notNullish } from '@vitest/utils';
8
+ import { positionToOffset, lineSplitRE, isPrimitive, inspect, toArray, notNullish } from '@vitest/utils';
9
9
  import { performance as performance$1 } from 'node:perf_hooks';
10
10
  import { parseErrorStacktrace, parseStacktrace } from '@vitest/utils/source-map';
11
- import { T as TypeCheckError, g as getOutputFile, i as isTTY, h as hasFailedSnapshot } from './typechecker.CdcjdhoT.js';
11
+ import { T as TypeCheckError, g as getOutputFile, i as isTTY, h as hasFailedSnapshot } from './typechecker.cZ0LjdSi.js';
12
12
  import { mkdir, writeFile, readdir, stat, readFile } from 'node:fs/promises';
13
13
  import { Console } from 'node:console';
14
14
  import { Writable } from 'node:stream';
@@ -94,7 +94,7 @@ const parse = (text, reviver) => {
94
94
  */
95
95
  const stringify = (value, replacer, space) => {
96
96
  const $ = replacer && typeof replacer === object ?
97
- (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : undefined) :
97
+ (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
98
98
  (replacer || noop);
99
99
  const known = new Map;
100
100
  const input = [];
@@ -152,12 +152,12 @@ function printError(error, ctx, logger, options) {
152
152
  parseErrorStacktrace(error2) {
153
153
  if (options.task?.file.pool === "browser" && project.browser) {
154
154
  return project.browser.parseErrorStacktrace(error2, {
155
- ignoreStackEntries: options.fullStack ? [] : undefined
155
+ ignoreStackEntries: options.fullStack ? [] : void 0
156
156
  });
157
157
  }
158
158
  return parseErrorStacktrace(error2, {
159
159
  frameFilter: project.config.onStackTrace,
160
- ignoreStackEntries: options.fullStack ? [] : undefined
160
+ ignoreStackEntries: options.fullStack ? [] : void 0
161
161
  });
162
162
  }
163
163
  });
@@ -596,7 +596,7 @@ class BaseReporter {
596
596
  watchFilters;
597
597
  failedUnwatchedFiles = [];
598
598
  isTTY;
599
- ctx = undefined;
599
+ ctx = void 0;
600
600
  renderSucceed = false;
601
601
  verbose = false;
602
602
  _filesInWatchMode = /* @__PURE__ */ new Map();
@@ -641,10 +641,11 @@ class BaseReporter {
641
641
  if (!("filepath" in task) || !task.result?.state || task.result?.state === "run" || task.result?.state === "queued") {
642
642
  return;
643
643
  }
644
- const tests = getTests(task);
645
- const failed = tests.filter((t) => t.result?.state === "fail");
646
- const skipped = tests.filter((t) => t.mode === "skip" || t.mode === "todo");
647
- let state = c.dim(`${tests.length} test${tests.length > 1 ? "s" : ""}`);
644
+ const suites = getSuites(task);
645
+ const allTests = getTests(task);
646
+ const failed = allTests.filter((t) => t.result?.state === "fail");
647
+ const skipped = allTests.filter((t) => t.mode === "skip" || t.mode === "todo");
648
+ let state = c.dim(`${allTests.length} test${allTests.length > 1 ? "s" : ""}`);
648
649
  if (failed.length) {
649
650
  state += c.dim(" | ") + c.red(`${failed.length} failed`);
650
651
  }
@@ -663,32 +664,52 @@ class BaseReporter {
663
664
  title += ` ${formatProjectName(task.projectName, "")}`;
664
665
  }
665
666
  this.log(` ${title} ${task.name} ${suffix}`);
666
- const anyFailed = tests.some((test) => test.result?.state === "fail");
667
- for (const test of tests) {
668
- const { duration, retryCount, repeatCount } = test.result || {};
669
- let suffix2 = "";
670
- if (retryCount != null && retryCount > 0) {
671
- suffix2 += c.yellow(` (retry x${retryCount})`);
672
- }
673
- if (repeatCount != null && repeatCount > 0) {
674
- suffix2 += c.yellow(` (repeat x${repeatCount})`);
667
+ for (const suite of suites) {
668
+ const tests = suite.tasks.filter((task2) => task2.type === "test");
669
+ if (!("filepath" in suite)) {
670
+ this.printSuite(suite);
675
671
  }
676
- if (test.result?.state === "fail") {
677
- this.log(c.red(` ${taskFail} ${getTestName(test, c.dim(" > "))}${this.getDurationPrefix(test)}`) + suffix2);
678
- test.result?.errors?.forEach((e) => {
679
- this.log(c.red(` ${F_RIGHT} ${e?.message}`));
680
- });
681
- } else if (duration && duration > this.ctx.config.slowTestThreshold) {
682
- this.log(
683
- ` ${c.yellow(c.dim(F_CHECK))} ${getTestName(test, c.dim(" > "))} ${c.yellow(Math.round(duration) + c.dim("ms"))}${suffix2}`
684
- );
685
- } else if (this.ctx.config.hideSkippedTests && (test.mode === "skip" || test.result?.state === "skip")) ; else if (test.result?.state === "skip" && test.result.note) {
686
- this.log(` ${getStateSymbol(test)} ${getTestName(test)}${c.dim(c.gray(` [${test.result.note}]`))}`);
687
- } else if (this.renderSucceed || anyFailed) {
688
- this.log(` ${getStateSymbol(test)} ${getTestName(test, c.dim(" > "))}${suffix2}`);
672
+ for (const test of tests) {
673
+ const { duration, retryCount, repeatCount } = test.result || {};
674
+ const padding = this.getTestIndentation(test);
675
+ let suffix2 = "";
676
+ if (retryCount != null && retryCount > 0) {
677
+ suffix2 += c.yellow(` (retry x${retryCount})`);
678
+ }
679
+ if (repeatCount != null && repeatCount > 0) {
680
+ suffix2 += c.yellow(` (repeat x${repeatCount})`);
681
+ }
682
+ if (test.result?.state === "fail") {
683
+ this.log(c.red(` ${padding}${taskFail} ${this.getTestName(test, c.dim(" > "))}${this.getDurationPrefix(test)}`) + suffix2);
684
+ test.result?.errors?.forEach((error) => {
685
+ const message = this.formatShortError(error);
686
+ if (message) {
687
+ this.log(c.red(` ${padding}${message}`));
688
+ }
689
+ });
690
+ } else if (duration && duration > this.ctx.config.slowTestThreshold) {
691
+ this.log(
692
+ ` ${padding}${c.yellow(c.dim(F_CHECK))} ${this.getTestName(test, c.dim(" > "))} ${c.yellow(Math.round(duration) + c.dim("ms"))}${suffix2}`
693
+ );
694
+ } else if (this.ctx.config.hideSkippedTests && (test.mode === "skip" || test.result?.state === "skip")) ; else if (test.result?.state === "skip" && test.result.note) {
695
+ this.log(` ${padding}${getStateSymbol(test)} ${this.getTestName(test)}${c.dim(c.gray(` [${test.result.note}]`))}`);
696
+ } else if (this.renderSucceed || failed.length > 0) {
697
+ this.log(` ${padding}${getStateSymbol(test)} ${this.getTestName(test, c.dim(" > "))}${suffix2}`);
698
+ }
689
699
  }
690
700
  }
691
701
  }
702
+ printSuite(_task) {
703
+ }
704
+ getTestName(test, separator) {
705
+ return getTestName(test, separator);
706
+ }
707
+ formatShortError(error) {
708
+ return `${F_RIGHT} ${error.message}`;
709
+ }
710
+ getTestIndentation(_test) {
711
+ return " ";
712
+ }
692
713
  getDurationPrefix(task) {
693
714
  if (!task.result?.duration) {
694
715
  return "";
@@ -752,7 +773,7 @@ class BaseReporter {
752
773
  const output = log.type === "stdout" ? this.ctx.logger.outputStream : this.ctx.logger.errorStream;
753
774
  const write = (msg) => output.write(msg);
754
775
  let headerText = "unknown test";
755
- const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) : undefined;
776
+ const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) : void 0;
756
777
  if (task) {
757
778
  headerText = getFullName(task, c.dim(" > "));
758
779
  } else if (log.taskId && log.taskId !== "__vitest__unknown_test__") {
@@ -872,7 +893,7 @@ class BaseReporter {
872
893
  const failedTests = tests.filter((i) => i.result?.state === "fail");
873
894
  const failedTotal = countTestErrors(failedSuites) + countTestErrors(failedTests);
874
895
  let current = 1;
875
- const errorDivider = () => this.error(`${c.red(c.dim(divider(`[${current++}/${failedTotal}]`, undefined, 1)))}
896
+ const errorDivider = () => this.error(`${c.red(c.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}
876
897
  `);
877
898
  if (failedSuites.length) {
878
899
  this.error(`
@@ -994,7 +1015,7 @@ class WindowRenderer {
994
1015
  options;
995
1016
  streams;
996
1017
  buffer = [];
997
- renderInterval = undefined;
1018
+ renderInterval = void 0;
998
1019
  renderScheduled = false;
999
1020
  windowHeight = 0;
1000
1021
  finished = false;
@@ -1146,7 +1167,7 @@ class SummaryReporter {
1146
1167
  startTime = "";
1147
1168
  currentTime = 0;
1148
1169
  duration = 0;
1149
- durationInterval = undefined;
1170
+ durationInterval = void 0;
1150
1171
  onInit(ctx, options = {}) {
1151
1172
  this.ctx = ctx;
1152
1173
  this.options = {
@@ -1428,7 +1449,7 @@ class DefaultReporter extends BaseReporter {
1428
1449
  }
1429
1450
  onPathsCollected(paths = []) {
1430
1451
  if (this.isTTY) {
1431
- if (this.renderSucceed === undefined) {
1452
+ if (this.renderSucceed === void 0) {
1432
1453
  this.renderSucceed = !!this.renderSucceed;
1433
1454
  }
1434
1455
  if (this.renderSucceed !== true) {
@@ -1557,7 +1578,7 @@ function formatTests(states) {
1557
1578
  }
1558
1579
 
1559
1580
  class GithubActionsReporter {
1560
- ctx = undefined;
1581
+ ctx = void 0;
1561
1582
  onInit(ctx) {
1562
1583
  this.ctx = ctx;
1563
1584
  }
@@ -1863,7 +1884,7 @@ class JUnitReporter {
1863
1884
  const pairs = [];
1864
1885
  for (const key in attrs) {
1865
1886
  const attr = attrs[key];
1866
- if (attr === undefined) {
1887
+ if (attr === void 0) {
1867
1888
  continue;
1868
1889
  }
1869
1890
  pairs.push(`${key}="${escapeXML(attr)}"`);
@@ -1909,7 +1930,7 @@ class JUnitReporter {
1909
1930
  "testcase",
1910
1931
  {
1911
1932
  classname,
1912
- file: this.options.addFileAttribute ? filename : undefined,
1933
+ file: this.options.addFileAttribute ? filename : void 0,
1913
1934
  name: task.name,
1914
1935
  time: getDuration(task)
1915
1936
  },
@@ -2038,7 +2059,7 @@ class JUnitReporter {
2038
2059
  this.ctx.logger.log(`JUNIT report written to ${this.reportFile}`);
2039
2060
  }
2040
2061
  await this.fileFd?.close();
2041
- this.fileFd = undefined;
2062
+ this.fileFd = void 0;
2042
2063
  }
2043
2064
  }
2044
2065
 
@@ -2183,6 +2204,27 @@ class VerboseReporter extends DefaultReporter {
2183
2204
  task.result.errors?.forEach((error) => this.log(c.red(` ${F_RIGHT} ${error?.message}`)));
2184
2205
  }
2185
2206
  }
2207
+ printSuite(task) {
2208
+ const indentation = " ".repeat(getIndentation(task));
2209
+ const tests = getTests(task);
2210
+ const state = getStateSymbol(task);
2211
+ this.log(` ${indentation}${state} ${task.name} ${c.dim(`(${tests.length})`)}`);
2212
+ }
2213
+ getTestName(test) {
2214
+ return test.name;
2215
+ }
2216
+ getTestIndentation(test) {
2217
+ return " ".repeat(getIndentation(test));
2218
+ }
2219
+ formatShortError() {
2220
+ return "";
2221
+ }
2222
+ }
2223
+ function getIndentation(suite, level = 1) {
2224
+ if (suite.suite && !("filepath" in suite.suite)) {
2225
+ return getIndentation(suite.suite, level + 1);
2226
+ }
2227
+ return level;
2186
2228
  }
2187
2229
 
2188
2230
  function createBenchmarkJsonReport(files) {
@@ -2372,7 +2414,7 @@ ${padding}`;
2372
2414
  if (typeof data === "string") {
2373
2415
  data = stripVTControlCharacters(data.trim().split("\n").filter(Boolean).pop());
2374
2416
  if (data === "") {
2375
- data = undefined;
2417
+ data = void 0;
2376
2418
  }
2377
2419
  }
2378
2420
  if (data != null) {
@@ -2430,7 +2472,6 @@ class BenchmarkReporter extends DefaultReporter {
2430
2472
  this.log(renderTable({
2431
2473
  tasks: benches,
2432
2474
  level: 1,
2433
- shallow: true,
2434
2475
  columns: this.ctx.logger.getColumns(),
2435
2476
  compare: this.compare,
2436
2477
  showHeap: this.ctx.config.logHeapUsage,
@@ -400,11 +400,11 @@ function requireKleur () {
400
400
  rgx: new RegExp(`\\x1b\\[${close}m`, 'g')
401
401
  };
402
402
  return function (txt) {
403
- if (this !== undefined && this.has !== undefined) {
403
+ if (this !== void 0 && this.has !== void 0) {
404
404
  this.has.includes(open) || (this.has.push(open),this.keys.push(blk));
405
- return txt === undefined ? this : $.enabled ? run(this.keys, txt+'') : txt+'';
405
+ return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';
406
406
  }
407
- return txt === undefined ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';
407
+ return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';
408
408
  };
409
409
  }
410
410
 
@@ -816,7 +816,7 @@ function requirePrompt$1 () {
816
816
  this.in = opts.stdin || process.stdin;
817
817
  this.out = opts.stdout || process.stdout;
818
818
 
819
- this.onRender = (opts.onRender || (() => undefined)).bind(this);
819
+ this.onRender = (opts.onRender || (() => void 0)).bind(this);
820
820
 
821
821
  const rl = readline.createInterface({
822
822
  input: this.in,
@@ -2760,7 +2760,7 @@ function requireAutocomplete$1 () {
2760
2760
  reset() {
2761
2761
  this.input = '';
2762
2762
  this.complete(() => {
2763
- this.moveSelect(this.initial !== undefined ? this.initial : 0);
2763
+ this.moveSelect(this.initial !== void 0 ? this.initial : 0);
2764
2764
  this.render();
2765
2765
  });
2766
2766
  this.render();
@@ -3973,7 +3973,7 @@ function requirePrompt () {
3973
3973
  this.firstRender = true;
3974
3974
  this.in = opts.stdin || process.stdin;
3975
3975
  this.out = opts.stdout || process.stdout;
3976
- this.onRender = (opts.onRender || (() => undefined)).bind(this);
3976
+ this.onRender = (opts.onRender || (() => void 0)).bind(this);
3977
3977
  const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });
3978
3978
  readline.emitKeypressEvents(this.in, rl);
3979
3979
 
@@ -5735,7 +5735,7 @@ function requireAutocomplete () {
5735
5735
  reset() {
5736
5736
  this.input = '';
5737
5737
  this.complete(() => {
5738
- this.moveSelect(this.initial !== undefined ? this.initial : 0);
5738
+ this.moveSelect(this.initial !== void 0 ? this.initial : 0);
5739
5739
  this.render();
5740
5740
  });
5741
5741
  this.render();
@@ -6502,7 +6502,7 @@ function requireLib () {
6502
6502
  // update vars in case they changed
6503
6503
  ({ name, type } = question);
6504
6504
 
6505
- if (prompts[type] === undefined) {
6505
+ if (prompts[type] === void 0) {
6506
6506
  throw new Error(`prompt type (${type}) is not defined`);
6507
6507
  }
6508
6508
 
@@ -1,9 +1,9 @@
1
1
  import * as chai from 'chai';
2
2
  import { resolve } from 'node:path';
3
- import { t as takeCoverageInsideWorker } from './coverage.BWeNbfBa.js';
3
+ import { t as takeCoverageInsideWorker } from './coverage.DnNIv-kJ.js';
4
4
  import { distDir } from '../path.js';
5
- import { r as rpc } from './rpc.Bf456uf4.js';
6
- import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.jLbIuaww.js';
5
+ import { r as rpc } from './rpc.TVf73xOu.js';
6
+ import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.IrcyRZ8C.js';
7
7
  import { g as getWorkerState } from './utils.C8RiOc4B.js';
8
8
 
9
9
  function setupChaiConfig(config) {
@@ -373,7 +373,7 @@ var happy = {
373
373
  const { Window } = await import('happy-dom');
374
374
  let win = new Window({
375
375
  ...happyDOM,
376
- console: console && globalThis.console ? globalThis.console : undefined,
376
+ console: console && globalThis.console ? globalThis.console : void 0,
377
377
  url: happyDOM.url || "http://localhost:3000",
378
378
  settings: {
379
379
  ...happyDOM.settings,
@@ -390,7 +390,7 @@ var happy = {
390
390
  },
391
391
  async teardown() {
392
392
  await teardownWindow(win);
393
- win = undefined;
393
+ win = void 0;
394
394
  }
395
395
  };
396
396
  },
@@ -398,7 +398,7 @@ var happy = {
398
398
  const { Window, GlobalWindow } = await import('happy-dom');
399
399
  const win = new (GlobalWindow || Window)({
400
400
  ...happyDOM,
401
- console: console && global.console ? global.console : undefined,
401
+ console: console && global.console ? global.console : void 0,
402
402
  url: happyDOM.url || "http://localhost:3000",
403
403
  settings: {
404
404
  ...happyDOM.settings,
@@ -466,11 +466,11 @@ var jsdom = {
466
466
  } = jsdom;
467
467
  let dom = new JSDOM(html, {
468
468
  pretendToBeVisual,
469
- resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : undefined),
469
+ resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
470
470
  runScripts,
471
471
  url,
472
- virtualConsole: console && globalThis.console ? new VirtualConsole().sendTo(globalThis.console) : undefined,
473
- cookieJar: cookieJar ? new CookieJar() : undefined,
472
+ virtualConsole: console && globalThis.console ? new VirtualConsole().sendTo(globalThis.console) : void 0,
473
+ cookieJar: cookieJar ? new CookieJar() : void 0,
474
474
  includeNodeLocations,
475
475
  contentType,
476
476
  userAgent,
@@ -503,7 +503,7 @@ var jsdom = {
503
503
  teardown() {
504
504
  clearWindowErrors();
505
505
  dom.window.close();
506
- dom = undefined;
506
+ dom = void 0;
507
507
  }
508
508
  };
509
509
  },
@@ -524,11 +524,11 @@ var jsdom = {
524
524
  } = jsdom;
525
525
  const dom = new JSDOM(html, {
526
526
  pretendToBeVisual,
527
- resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : undefined),
527
+ resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
528
528
  runScripts,
529
529
  url,
530
- virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : undefined,
531
- cookieJar: cookieJar ? new CookieJar() : undefined,
530
+ virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
531
+ cookieJar: cookieJar ? new CookieJar() : void 0,
532
532
  includeNodeLocations,
533
533
  contentType,
534
534
  userAgent,
@@ -633,8 +633,8 @@ var node = {
633
633
  return context;
634
634
  },
635
635
  teardown() {
636
- context = undefined;
637
- global = undefined;
636
+ context = void 0;
637
+ global = void 0;
638
638
  }
639
639
  };
640
640
  },
@@ -1,4 +1,4 @@
1
- import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.CjhMlMwf.js';
1
+ import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.DrftpPF8.js';
2
2
  import { i as isFirstRun, a as runOnce } from './run-once.2ogXb3JV.js';
3
3
  import { b as bench } from './benchmark.Cdu9hjj4.js';
4
4
  import { expectTypeOf } from 'expect-type';
@@ -9,7 +9,7 @@ function setupInspect(ctx) {
9
9
  const isEnabled = config.inspector.enabled;
10
10
  if (isEnabled) {
11
11
  inspector = __require("node:inspector");
12
- const isOpen = inspector.url() !== undefined;
12
+ const isOpen = inspector.url() !== void 0;
13
13
  if (!isOpen) {
14
14
  inspector.open(
15
15
  config.inspector.port,