vitest 4.1.0-beta.5 → 4.1.0

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 (50) hide show
  1. package/README.md +1 -1
  2. package/browser/context.d.ts +1 -1
  3. package/dist/browser.d.ts +2 -1
  4. package/dist/browser.js +1 -1
  5. package/dist/chunks/{base.BzdSbvqu.js → base.DM0-RqVb.js} +9 -9
  6. package/dist/chunks/{cac.BvpGf9db.js → cac.CWGDZnXT.js} +6 -6
  7. package/dist/chunks/{cli-api.D__YrL6a.js → cli-api.DuT9iuvY.js} +69 -34
  8. package/dist/chunks/{console.DpQfzR9G.js → console.3WNpx0tS.js} +1 -1
  9. package/dist/chunks/{coverage.DUqi2f6q.js → coverage.Bri33R1t.js} +3 -3
  10. package/dist/chunks/{defaults.BlJmGxXD.js → defaults.CdU2lD-q.js} +2 -2
  11. package/dist/chunks/{globals.DgrX1FjK.js → globals.BXNGLnTL.js} +3 -3
  12. package/dist/chunks/{index.CPRfxlYj.js → index.CEzQDJGb.js} +1 -1
  13. package/dist/chunks/{index.Bd3kKDSS.js → index.DGNSnENe.js} +3 -3
  14. package/dist/chunks/{index.mNs4_sfP.js → index.DXMFO5MJ.js} +573 -316
  15. package/dist/chunks/{index.DqEi5Ycp.js → index.DlDSLQD3.js} +1 -1
  16. package/dist/chunks/{index.CyBMJtT7.js → index.EY6TCHpo.js} +10 -8
  17. package/dist/chunks/{init-forks.Uz2iUy-b.js → init-forks.DeArv0jT.js} +1 -1
  18. package/dist/chunks/{init-threads.u8FhyhU_.js → init-threads.-2OUl4Nn.js} +1 -1
  19. package/dist/chunks/{init.DzWSvu83.js → init.DICorXCo.js} +3 -3
  20. package/dist/chunks/{native.mV0-490A.js → native.DPzPHdi5.js} +1 -1
  21. package/dist/chunks/{nativeModuleMocker.Bt11nCqn.js → nativeModuleMocker.DndvSdL6.js} +1 -1
  22. package/dist/chunks/{plugin.d.BA1SfGdt.d.ts → plugin.d.BuW-flqo.d.ts} +1 -1
  23. package/dist/chunks/{reporters.d.pZWLB1PG.d.ts → reporters.d.DVUYHHhe.d.ts} +68 -13
  24. package/dist/chunks/{rpc.CYazvPD1.js → rpc.MzXet3jl.js} +1 -5
  25. package/dist/chunks/{setup-common.BRHvdzsc.js → setup-common.B41N_kPE.js} +1 -1
  26. package/dist/chunks/{startVitestModuleRunner.BRvQz4ko.js → startVitestModuleRunner.C3ZR-4J3.js} +54 -12
  27. package/dist/chunks/{test.BwzWwv9M.js → test.CTcmp4Su.js} +17 -3
  28. package/dist/chunks/{vm.D32oUcpO.js → vm.Dh2rTtmP.js} +3 -3
  29. package/dist/cli.js +3 -3
  30. package/dist/config.cjs +1 -1
  31. package/dist/config.d.ts +3 -3
  32. package/dist/config.js +1 -1
  33. package/dist/coverage.d.ts +1 -1
  34. package/dist/coverage.js +2 -2
  35. package/dist/environments.js +1 -1
  36. package/dist/index.js +3 -3
  37. package/dist/node.d.ts +4 -4
  38. package/dist/node.js +9 -9
  39. package/dist/nodejs-worker-loader.js +1 -1
  40. package/dist/reporters.d.ts +1 -1
  41. package/dist/reporters.js +4 -4
  42. package/dist/runners.js +2 -2
  43. package/dist/runtime.js +2 -2
  44. package/dist/worker.js +9 -9
  45. package/dist/workers/forks.js +10 -10
  46. package/dist/workers/runVmTests.js +5 -5
  47. package/dist/workers/threads.js +10 -10
  48. package/dist/workers/vmForks.js +7 -7
  49. package/dist/workers/vmThreads.js +7 -7
  50. package/package.json +16 -16
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # vitest
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/vitest?color=a1b858&label=)](https://www.npmjs.com/package/vitest)
3
+ [![NPM version](https://img.shields.io/npm/v/vitest?color=a1b858&label=)](https://npmx.dev/package/vitest)
4
4
 
5
5
  Next generation testing framework powered by Vite.
6
6
 
@@ -4,4 +4,4 @@ export * from '@vitest/browser-playwright/context'
4
4
  export * from '@vitest/browser-webdriverio/context'
5
5
  // @ts-ignore -- @vitest/browser-preview might not be installed
6
6
  export * from '@vitest/browser-preview/context'
7
- export { BrowserCommands, FsOptions } from 'vitest/internal/browser'
7
+ export { BrowserCommands, CDPSession, FsOptions } from 'vitest/internal/browser'
package/dist/browser.d.ts CHANGED
@@ -41,6 +41,7 @@ interface BrowserCommands {
41
41
  })) => Promise<void>;
42
42
  removeFile: (path: string) => Promise<void>;
43
43
  }
44
+ interface CDPSession {}
44
45
 
45
46
  export { loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
46
- export type { BrowserCommands, FsOptions };
47
+ export type { BrowserCommands, CDPSession, FsOptions };
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.BRHvdzsc.js';
1
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.B41N_kPE.js';
2
2
  export { T as Traces } from './chunks/traces.CCmnQaNT.js';
3
3
  export { collectTests, startTests } from '@vitest/runner';
4
4
  import * as spyModule from '@vitest/spy';
@@ -1,22 +1,22 @@
1
1
  import { runInThisContext } from 'node:vm';
2
2
  import * as spyModule from '@vitest/spy';
3
- import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.Bd3kKDSS.js';
4
- import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.DzWSvu83.js';
3
+ import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.DGNSnENe.js';
4
+ import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.DICorXCo.js';
5
5
  import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
6
6
  import { T as Traces } from './traces.CCmnQaNT.js';
7
7
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
8
- import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.BRvQz4ko.js';
8
+ import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.C3ZR-4J3.js';
9
9
  import { performance as performance$1 } from 'node:perf_hooks';
10
10
  import { startTests, collectTests } from '@vitest/runner';
11
- import { s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker } from './setup-common.BRHvdzsc.js';
12
- import { g as globalExpect, v as vi } from './test.BwzWwv9M.js';
11
+ import { s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker } from './setup-common.B41N_kPE.js';
12
+ import { g as globalExpect, v as vi } from './test.CTcmp4Su.js';
13
13
  import { c as closeInspector } from './inspector.CvyFGlXm.js';
14
14
  import { createRequire } from 'node:module';
15
15
  import timers from 'node:timers';
16
16
  import timersPromises from 'node:timers/promises';
17
17
  import util from 'node:util';
18
18
  import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
19
- import { i as index } from './index.DqEi5Ycp.js';
19
+ import { i as index } from './index.DlDSLQD3.js';
20
20
  import { g as getWorkerState, r as resetModules, p as provideWorkerState, a as getSafeWorkerState } from './utils.BX5Fg8C4.js';
21
21
 
22
22
  // this should only be used in Node
@@ -58,7 +58,7 @@ function resolveAsset(mod, url) {
58
58
  mod.exports = url;
59
59
  }
60
60
  async function setupConsoleLogSpy() {
61
- const { createCustomConsole } = await import('./console.DpQfzR9G.js');
61
+ const { createCustomConsole } = await import('./console.3WNpx0tS.js');
62
62
  globalThis.console = createCustomConsole();
63
63
  }
64
64
 
@@ -115,7 +115,7 @@ async function startModuleRunner(options) {
115
115
  let mocker;
116
116
  if (options.state.config.experimental.nodeLoader !== false) {
117
117
  // this additionally imports acorn/magic-string
118
- const { NativeModuleMocker } = await import('./nativeModuleMocker.Bt11nCqn.js');
118
+ const { NativeModuleMocker } = await import('./nativeModuleMocker.DndvSdL6.js');
119
119
  mocker = new NativeModuleMocker({
120
120
  async resolveId(id, importer) {
121
121
  // TODO: use import.meta.resolve instead
@@ -141,7 +141,7 @@ let _environmentTime;
141
141
  /** @experimental */
142
142
  async function setupBaseEnvironment(context) {
143
143
  if (context.config.experimental.viteModuleRunner === false) {
144
- const { setupNodeLoaderHooks } = await import('./native.mV0-490A.js');
144
+ const { setupNodeLoaderHooks } = await import('./native.DPzPHdi5.js');
145
145
  await setupNodeLoaderHooks(context);
146
146
  }
147
147
  const startTime = performance.now();
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import { normalize } from 'pathe';
4
4
  import c$2 from 'tinyrainbow';
5
5
  import { b as defaultPort, d as defaultBrowserPort } from './constants.CPYnjOGj.js';
6
- import { R as ReportersMap } from './index.mNs4_sfP.js';
6
+ import { R as ReportersMap } from './index.DXMFO5MJ.js';
7
7
  import assert from 'node:assert';
8
8
 
9
9
  function toArr(any) {
@@ -620,7 +620,7 @@ class CAC extends EventEmitter {
620
620
 
621
621
  const cac = (name = "") => new CAC(name);
622
622
 
623
- var version = "4.1.0-beta.5";
623
+ var version = "4.1.0";
624
624
 
625
625
  const apiConfig = (port) => ({
626
626
  port: {
@@ -2312,11 +2312,11 @@ function normalizeCliOptions(cliFilters, argv) {
2312
2312
  }
2313
2313
  async function start(mode, cliFilters, options) {
2314
2314
  try {
2315
- const { startVitest } = await import('./cli-api.D__YrL6a.js').then(function (n) { return n.q; });
2315
+ const { startVitest } = await import('./cli-api.DuT9iuvY.js').then(function (n) { return n.q; });
2316
2316
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2317
2317
  if (!ctx.shouldKeepServer()) await ctx.exit();
2318
2318
  } catch (e) {
2319
- const { errorBanner } = await import('./index.mNs4_sfP.js').then(function (n) { return n.A; });
2319
+ const { errorBanner } = await import('./index.DXMFO5MJ.js').then(function (n) { return n.C; });
2320
2320
  console.error(`\n${errorBanner("Startup Error")}`);
2321
2321
  console.error(e);
2322
2322
  console.error("\n\n");
@@ -2334,7 +2334,7 @@ async function init(project) {
2334
2334
  }
2335
2335
  async function collect(mode, cliFilters, options) {
2336
2336
  try {
2337
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.D__YrL6a.js').then(function (n) { return n.q; });
2337
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DuT9iuvY.js').then(function (n) { return n.q; });
2338
2338
  const ctx = await prepareVitest(mode, {
2339
2339
  ...normalizeCliOptions(cliFilters, options),
2340
2340
  watch: false,
@@ -2356,7 +2356,7 @@ async function collect(mode, cliFilters, options) {
2356
2356
  } else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
2357
2357
  await ctx.close();
2358
2358
  } catch (e) {
2359
- const { errorBanner } = await import('./index.mNs4_sfP.js').then(function (n) { return n.A; });
2359
+ const { errorBanner } = await import('./index.DXMFO5MJ.js').then(function (n) { return n.C; });
2360
2360
  console.error(`\n${errorBanner("Collect Error")}`);
2361
2361
  console.error(e);
2362
2362
  console.error("\n\n");
@@ -12,13 +12,14 @@ import * as nodeos from 'node:os';
12
12
  import nodeos__default, { tmpdir } from 'node:os';
13
13
  import { generateHash as generateHash$1, createTaskName, validateTags, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, getTasks, isTestCase } from '@vitest/runner/utils';
14
14
  import { SnapshotManager } from '@vitest/snapshot/manager';
15
- import { v as version$1 } from './cac.BvpGf9db.js';
15
+ import { serializeValue } from '@vitest/utils/serialize';
16
+ import { v as version$1 } from './cac.CWGDZnXT.js';
16
17
  import { rootDir, distDir } from '../path.js';
17
- import { d as createIndexLocationsMap, e as TraceMap, o as originalPositionFor, h as ancestor, i as stringify, p as parse, j as printError, f as formatProjectName, w as withLabel, k as errorBanner, l as divider, m as Typechecker, n as generateCodeFrame, q as escapeRegExp, r as createDefinesScript, R as ReportersMap, u as groupBy, B as BlobReporter, v as readBlobs, x as convertTasksToEvents, H as HangingProcessReporter, y as wildcardPatternToRegExp, z as stdout } from './index.mNs4_sfP.js';
18
+ import { d as createIndexLocationsMap, e as TraceMap, o as originalPositionFor, h as ancestor, i as stringify, p as parse, j as printError, f as formatProjectName, w as withLabel, k as errorBanner, l as divider, m as Typechecker, n as generateCodeFrame, q as escapeRegExp, r as createDefinesScript, R as ReportersMap, u as groupBy, B as BlobReporter, v as readBlobs, x as convertTasksToEvents, H as HangingProcessReporter, y as wildcardPatternToRegExp, z as stdout } from './index.DXMFO5MJ.js';
18
19
  import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
19
20
  import { T as Traces } from './traces.CCmnQaNT.js';
20
21
  import { createDebug } from 'obug';
21
- import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.DUqi2f6q.js';
22
+ import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.Bri33R1t.js';
22
23
  import { rm, readFile, writeFile, rename, stat, unlink, mkdir, copyFile } from 'node:fs/promises';
23
24
  import c from 'tinyrainbow';
24
25
  import { VitestModuleEvaluator } from '#module-evaluator';
@@ -48,15 +49,14 @@ import require$$0$2 from 'stream';
48
49
  import require$$7 from 'url';
49
50
  import require$$0 from 'zlib';
50
51
  import require$$0$1 from 'buffer';
51
- import { c as configDefaults } from './defaults.BlJmGxXD.js';
52
+ import { c as configDefaults } from './defaults.CdU2lD-q.js';
52
53
  import MagicString from 'magic-string';
53
54
  import { hoistMocksPlugin, automockPlugin } from '@vitest/mocker/node';
54
55
  import { KNOWN_ASSET_RE } from '@vitest/utils/constants';
55
56
  import { findNearestPackageData } from '@vitest/utils/resolver';
56
57
  import * as esModuleLexer from 'es-module-lexer';
57
- import { a as BenchmarkReportsMap } from './index.CPRfxlYj.js';
58
+ import { a as BenchmarkReportsMap } from './index.CEzQDJGb.js';
58
59
  import assert$1 from 'node:assert';
59
- import { serializeValue } from '@vitest/utils/serialize';
60
60
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
61
61
  import { extractSourcemapFromFile } from '@vitest/utils/source-map/node';
62
62
  import readline from 'node:readline';
@@ -136,8 +136,8 @@ function astParseFile(filepath, code) {
136
136
  if (callee.type === "MemberExpression") {
137
137
  if (callee.object?.type === "Identifier" && isVitestFunctionName(callee.object.name)) return callee.object?.name;
138
138
  if (callee.object?.name?.startsWith("__vite_ssr_") || callee.object?.object?.name?.startsWith("__vite_ssr_") && callee.object?.property?.name === "Vitest") return getName(callee.property);
139
- // call as `__vite_ssr__.test.skip()`
140
- return getName(callee.object?.property);
139
+ // call as `__vite_ssr__.test.skip()` or `describe.concurrent.each()`
140
+ return getName(callee.object);
141
141
  }
142
142
  // unwrap (0, ...)
143
143
  if (callee.type === "SequenceExpression" && callee.expressions.length === 2) {
@@ -146,6 +146,18 @@ function astParseFile(filepath, code) {
146
146
  }
147
147
  return null;
148
148
  };
149
+ const getProperties = (callee) => {
150
+ if (!callee) return [];
151
+ if (callee.type === "Identifier") return [];
152
+ if (callee.type === "CallExpression") return getProperties(callee.callee);
153
+ if (callee.type === "TaggedTemplateExpression") return getProperties(callee.tag);
154
+ if (callee.type === "MemberExpression") {
155
+ const props = getProperties(callee.object);
156
+ if (callee.property?.name) props.push(callee.property.name);
157
+ return props;
158
+ }
159
+ return [];
160
+ };
149
161
  ancestor(ast, { CallExpression(node) {
150
162
  const { callee } = node;
151
163
  const name = getName(callee);
@@ -154,10 +166,10 @@ function astParseFile(filepath, code) {
154
166
  verbose?.(`Skipping ${name} (unknown call)`);
155
167
  return;
156
168
  }
169
+ const properties = getProperties(callee);
157
170
  const property = callee?.property?.name;
158
- let mode = !property || property === name ? "run" : property;
159
- // they will be picked up in the next iteration
160
- if ([
171
+ // intermediate calls like .each(), .for() will be picked up in the next iteration
172
+ if (property && [
161
173
  "each",
162
174
  "for",
163
175
  "skipIf",
@@ -165,7 +177,13 @@ function astParseFile(filepath, code) {
165
177
  "extend",
166
178
  "scoped",
167
179
  "override"
168
- ].includes(mode)) return;
180
+ ].includes(property)) return;
181
+ // derive mode from the full chain (handles any order like .skip.concurrent or .concurrent.skip)
182
+ let mode = "run";
183
+ for (const prop of properties) if (prop === "skip" || prop === "only" || prop === "todo") mode = prop;
184
+ else if (prop === "skipIf" || prop === "runIf") mode = "skip";
185
+ let isConcurrent = properties.includes("concurrent");
186
+ let isSequential = properties.includes("sequential");
169
187
  let start;
170
188
  const end = node.end;
171
189
  // .each or (0, __vite_ssr_exports_0__.test)()
@@ -184,28 +202,28 @@ function astParseFile(filepath, code) {
184
202
  }
185
203
  if (message.startsWith("0,")) message = message.slice(2);
186
204
  message = message.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/__vi_import_\d+__\./g, "");
187
- // cannot statically analyze, so we always skip it
188
- if (mode === "skipIf" || mode === "runIf") mode = "skip";
189
205
  const parentCalleeName = typeof callee?.callee === "object" && callee?.callee.type === "MemberExpression" && callee?.callee.property?.name;
190
206
  let isDynamicEach = parentCalleeName === "each" || parentCalleeName === "for";
191
207
  if (!isDynamicEach && callee.type === "TaggedTemplateExpression") {
192
208
  const property = callee.tag?.property?.name;
193
209
  isDynamicEach = property === "each" || property === "for";
194
210
  }
195
- // Extract tags from the second argument if it's an options object
211
+ // Extract options from the second argument if it's an options object
196
212
  const tags = [];
197
213
  const secondArg = node.arguments?.[1];
198
- if (secondArg?.type === "ObjectExpression") {
199
- const tagsProperty = secondArg.properties?.find((p) => p.type === "Property" && p.key?.type === "Identifier" && p.key.name === "tags");
200
- if (tagsProperty) {
201
- const tagsValue = tagsProperty.value;
202
- if (tagsValue?.type === "Literal" && typeof tagsValue.value === "string")
203
- // tags: 'single-tag'
204
- tags.push(tagsValue.value);
214
+ if (secondArg?.type === "ObjectExpression") for (const prop of secondArg.properties || []) {
215
+ if (prop.type !== "Property" || prop.key?.type !== "Identifier") continue;
216
+ const keyName = prop.key.name;
217
+ if (keyName === "tags") {
218
+ const tagsValue = prop.value;
219
+ if (tagsValue?.type === "Literal" && typeof tagsValue.value === "string") tags.push(tagsValue.value);
205
220
  else if (tagsValue?.type === "ArrayExpression") {
206
- // tags: ['tag1', 'tag2']
207
221
  for (const element of tagsValue.elements || []) if (element?.type === "Literal" && typeof element.value === "string") tags.push(element.value);
208
222
  }
223
+ } else if (prop.value?.type === "Literal" && prop.value.value === true) {
224
+ if (keyName === "skip" || keyName === "only" || keyName === "todo") mode = keyName;
225
+ else if (keyName === "concurrent") isConcurrent = true;
226
+ else if (keyName === "sequential") isSequential = true;
209
227
  }
210
228
  }
211
229
  debug$1?.("Found", name, message, `(${mode})`, tags.length ? `[${tags.join(", ")}]` : "");
@@ -217,6 +235,8 @@ function astParseFile(filepath, code) {
217
235
  mode,
218
236
  task: null,
219
237
  dynamic: isDynamicEach,
238
+ concurrent: isConcurrent,
239
+ sequential: isSequential,
220
240
  tags
221
241
  });
222
242
  } });
@@ -311,6 +331,8 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
311
331
  } else debug$1?.("Cannot find original location for", definition.type, definition.name, `${processedLocation.column}:${processedLocation.line}`);
312
332
  } else debug$1?.("Cannot find original location for", definition.type, definition.name, `${definition.start}`);
313
333
  const taskTags = unique([...latestSuite.tags || [], ...definition.tags]);
334
+ // resolve concurrent/sequential: sequential cancels inherited concurrent
335
+ const concurrent = definition.sequential ? void 0 : definition.concurrent || latestSuite.concurrent || void 0;
314
336
  if (definition.type === "suite") {
315
337
  const task = {
316
338
  type: definition.type,
@@ -320,6 +342,7 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
320
342
  tasks: [],
321
343
  mode,
322
344
  each: definition.dynamic,
345
+ concurrent,
323
346
  name: definition.name,
324
347
  fullName: createTaskName([latestSuite.fullName, definition.name]),
325
348
  fullTestName: createTaskName([latestSuite.fullTestName, definition.name]),
@@ -342,6 +365,7 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
342
365
  suite: latestSuite,
343
366
  file,
344
367
  each: definition.dynamic,
368
+ concurrent,
345
369
  mode,
346
370
  context: {},
347
371
  name: definition.name,
@@ -1178,7 +1202,7 @@ function getCachedResult(result, tmp) {
1178
1202
  invalidate: result.invalidate
1179
1203
  };
1180
1204
  }
1181
- const MODULE_RUNNER_SOURCEMAPPING_REGEXP = /* @__PURE__ */ new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
1205
+ const MODULE_RUNNER_SOURCEMAPPING_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
1182
1206
  function extractSourceMap(code) {
1183
1207
  const pattern = `//# ${SOURCEMAPPING_URL}=data:application/json;base64,`;
1184
1208
  const lastIndex = code.lastIndexOf(pattern);
@@ -9894,7 +9918,7 @@ function silenceImportViteIgnoreWarning(logger) {
9894
9918
 
9895
9919
  const cssLangs = "\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)";
9896
9920
  const cssLangRE = new RegExp(cssLangs);
9897
- const cssModuleRE = /* @__PURE__ */ new RegExp(`\\.module${cssLangs}`);
9921
+ const cssModuleRE = new RegExp(`\\.module${cssLangs}`);
9898
9922
  const cssInlineRE = /[?&]inline(?:&|$)/;
9899
9923
  function isCSS(id) {
9900
9924
  return cssLangRE.test(id);
@@ -10177,7 +10201,7 @@ function processWildcard(dep, moduleDirectories) {
10177
10201
  if (typeof dep !== "string") return dep;
10178
10202
  if (typeof dep === "string" && dep.includes("*")) {
10179
10203
  const directories = (moduleDirectories || ["/node_modules/"]).map((r) => escapeRegExp(r));
10180
- return /* @__PURE__ */ new RegExp(`(${directories.join("|")})${dep.replace(/\*/g, "[\\w/]+")}`);
10204
+ return new RegExp(`(${directories.join("|")})${dep.replace(/\*/g, "[\\w/]+")}`);
10181
10205
  }
10182
10206
  return dep;
10183
10207
  }
@@ -11010,7 +11034,8 @@ function generateHash(str) {
11010
11034
  // vite.config.*
11011
11035
  // vitest.unit.config.*
11012
11036
  // vite.unit.config.*
11013
- const CONFIG_REGEXP = /^vite(?:st)?(?:\.\w+)?\.config\./;
11037
+ // vitest.unit-test.config.*
11038
+ const CONFIG_REGEXP = /^vite(?:st)?(?:\.[\w-]+)?\.config\./;
11014
11039
  async function resolveProjects(vitest, cliOptions, workspaceConfigPath, projectsDefinition, names) {
11015
11040
  const { configFiles, projectConfigs, nonConfigDirectories } = await resolveTestProjectConfigs(vitest, workspaceConfigPath, projectsDefinition);
11016
11041
  const cliOverrides = [
@@ -13187,11 +13212,13 @@ class Vitest {
13187
13212
  const specification = this.getProjectByName(file.projectName || "").createSpecification(file.filepath, void 0, file.pool);
13188
13213
  specifications.push(specification);
13189
13214
  }
13190
- await this._testRun.start(specifications).catch(noop);
13215
+ await this._testRun.start(specifications);
13191
13216
  await this.coverageProvider?.onTestRunStart?.();
13192
13217
  for (const file of files) await this._reportFileTask(file);
13193
- this._checkUnhandledErrors(errors);
13194
- await this._testRun.end(specifications, errors).catch(noop);
13218
+ // append errors thrown during reporter event replay during merge reports
13219
+ const unhandledErrors = [...errors, ...this.state.getUnhandledErrors()];
13220
+ this._checkUnhandledErrors(unhandledErrors);
13221
+ await this._testRun.end(specifications, unhandledErrors);
13195
13222
  await this.initCoverageProvider();
13196
13223
  await this.coverageProvider?.mergeReports?.(coverages);
13197
13224
  return {
@@ -13209,15 +13236,23 @@ class Vitest {
13209
13236
  /** @internal */
13210
13237
  async _reportFileTask(file) {
13211
13238
  const project = this.getProjectByName(file.projectName || "");
13212
- await this._testRun.enqueued(project, file).catch(noop);
13213
- await this._testRun.collected(project, [file]).catch(noop);
13239
+ await this._testRun.enqueued(project, file).catch((error) => {
13240
+ this.state.catchError(serializeValue(error), "Unhandled Reporter Error");
13241
+ });
13242
+ await this._testRun.collected(project, [file]).catch((error) => {
13243
+ this.state.catchError(serializeValue(error), "Unhandled Reporter Error");
13244
+ });
13214
13245
  const logs = [];
13215
13246
  const { packs, events } = convertTasksToEvents(file, (task) => {
13216
13247
  if (task.logs) logs.push(...task.logs);
13217
13248
  });
13218
13249
  logs.sort((log1, log2) => log1.time - log2.time);
13219
- for (const log of logs) await this._testRun.log(log).catch(noop);
13220
- await this._testRun.updated(packs, events).catch(noop);
13250
+ for (const log of logs) await this._testRun.log(log).catch((error) => {
13251
+ this.state.catchError(serializeValue(error), "Unhandled Reporter Error");
13252
+ });
13253
+ await this._testRun.updated(packs, events).catch((error) => {
13254
+ this.state.catchError(serializeValue(error), "Unhandled Reporter Error");
13255
+ });
13221
13256
  }
13222
13257
  async collect(filters, options) {
13223
13258
  return this._traces.$("vitest.collect", async (collectSpan) => {
@@ -3,7 +3,7 @@ import { relative } from 'node:path';
3
3
  import { Writable } from 'node:stream';
4
4
  import { getSafeTimers } from '@vitest/utils/timers';
5
5
  import c from 'tinyrainbow';
6
- import { R as RealDate } from './rpc.CYazvPD1.js';
6
+ import { R as RealDate } from './rpc.MzXet3jl.js';
7
7
  import { g as getWorkerState } from './utils.BX5Fg8C4.js';
8
8
  import './index.Chj8NDwU.js';
9
9
 
@@ -7,14 +7,14 @@ import { resolve, relative, normalize } from 'pathe';
7
7
  import pm from 'picomatch';
8
8
  import { glob } from 'tinyglobby';
9
9
  import c from 'tinyrainbow';
10
- import { c as configDefaults, e as benchmarkConfigDefaults, a as coverageConfigDefaults } from './defaults.BlJmGxXD.js';
10
+ import { c as configDefaults, e as benchmarkConfigDefaults, a as coverageConfigDefaults } from './defaults.CdU2lD-q.js';
11
11
  import crypto from 'node:crypto';
12
12
  import { r as resolveModule } from './index.BCY_7LL2.js';
13
13
  import { mergeConfig } from 'vite';
14
14
  import { c as configFiles, d as defaultBrowserPort, a as defaultInspectPort, b as defaultPort } from './constants.CPYnjOGj.js';
15
15
  import './env.D4Lgay0q.js';
16
16
  import nodeos__default from 'node:os';
17
- import { isCI, provider } from 'std-env';
17
+ import { isCI, isAgent, provider } from 'std-env';
18
18
  import { r as resolveCoverageProviderModule } from './coverage.D_JHT54q.js';
19
19
 
20
20
  const hash = crypto.hash ?? ((algorithm, data, outputEncoding) => crypto.createHash(algorithm).update(data).digest(outputEncoding));
@@ -430,7 +430,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
430
430
  }
431
431
  }
432
432
  if (!resolved.reporters.length) {
433
- resolved.reporters.push(["default", {}]);
433
+ resolved.reporters.push([isAgent ? "agent" : "default", {}]);
434
434
  // also enable github-actions reporter as a default
435
435
  if (process.env.GITHUB_ACTIONS === "true") resolved.reporters.push(["github-actions", {}]);
436
436
  }
@@ -1,6 +1,6 @@
1
1
  import nodeos__default from 'node:os';
2
2
  import './env.D4Lgay0q.js';
3
- import { isCI } from 'std-env';
3
+ import { isCI, isAgent } from 'std-env';
4
4
 
5
5
  const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
6
6
  const defaultExclude = ["**/node_modules/**", "**/.git/**"];
@@ -37,7 +37,7 @@ const fakeTimersDefaults = {
37
37
  const configDefaults = Object.freeze({
38
38
  allowOnly: !isCI,
39
39
  isolate: true,
40
- watch: !isCI && process.stdin.isTTY,
40
+ watch: !isCI && process.stdin.isTTY && !isAgent,
41
41
  globals: false,
42
42
  environment: "node",
43
43
  clearMocks: false,
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.CPYnjOGj.js';
2
- import { i as index } from './index.DqEi5Ycp.js';
3
- import './test.BwzWwv9M.js';
2
+ import { i as index } from './index.DlDSLQD3.js';
3
+ import './test.CTcmp4Su.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils/helpers';
6
6
  import '@vitest/utils/timers';
@@ -15,7 +15,7 @@ import '@vitest/spy';
15
15
  import '@vitest/utils/offset';
16
16
  import '@vitest/utils/source-map';
17
17
  import './_commonjsHelpers.D26ty3Ew.js';
18
- import './rpc.CYazvPD1.js';
18
+ import './rpc.MzXet3jl.js';
19
19
  import './index.Chj8NDwU.js';
20
20
  import './evaluatedModules.Dg1zASAC.js';
21
21
  import 'vite/module-runner';
@@ -2,7 +2,7 @@ import fs from 'node:fs';
2
2
  import { getTasks, getFullName, getTests } from '@vitest/runner/utils';
3
3
  import * as pathe from 'pathe';
4
4
  import c from 'tinyrainbow';
5
- import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.mNs4_sfP.js';
5
+ import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.DXMFO5MJ.js';
6
6
  import { stripVTControlCharacters } from 'node:util';
7
7
  import { notNullish } from '@vitest/utils/helpers';
8
8
 
@@ -1,9 +1,9 @@
1
1
  import { chai } from '@vitest/expect';
2
2
  import { createHook } from 'node:async_hooks';
3
- import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.BRHvdzsc.js';
4
- import { r as rpc } from './rpc.CYazvPD1.js';
3
+ import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.B41N_kPE.js';
4
+ import { r as rpc } from './rpc.MzXet3jl.js';
5
5
  import { g as getWorkerState } from './utils.BX5Fg8C4.js';
6
- import { T as TestRunner, N as NodeBenchmarkRunner } from './test.BwzWwv9M.js';
6
+ import { T as TestRunner, N as NodeBenchmarkRunner } from './test.CTcmp4Su.js';
7
7
 
8
8
  function setupChaiConfig(config) {
9
9
  Object.assign(chai.config, config);