@depup/vitest 4.1.4-depup.0 → 4.1.10-depup.8

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 (51) hide show
  1. package/README.md +13 -8
  2. package/changes.json +27 -7
  3. package/dist/browser.d.ts +2 -2
  4. package/dist/browser.js +1 -1
  5. package/dist/chunks/{base.Cv_yNPUJ.js → base.B6Opl8PE.js} +7 -7
  6. package/dist/chunks/{browser.d.C0zGu1u9.d.ts → browser.d.BcoexmFG.d.ts} +2 -2
  7. package/dist/chunks/{cac.wyYWMVI-.js → cac.DdICfEr1.js} +4 -4
  8. package/dist/chunks/{cli-api.lDy4N9kC.js → cli-api.BK8pd4xc.js} +51 -18
  9. package/dist/chunks/{config.d.ChUh6-ad.d.ts → config.d.A1h_Y6Jt.d.ts} +6 -1
  10. package/dist/chunks/{coverage.Da5gzbsu.js → coverage.DM_a_rWm.js} +10 -2
  11. package/dist/chunks/{global.d.D74z04P1.d.ts → global.d.DVsSRdQ5.d.ts} +1 -1
  12. package/dist/chunks/{globals.BVDtJR67.js → globals.Dj1TGiMC.js} +2 -2
  13. package/dist/chunks/{index.C3MK_gXn.js → index.DXx9Dtk7.js} +2 -2
  14. package/dist/chunks/{index.C-zNJvRx.js → index.DdgEv5B1.js} +1 -1
  15. package/dist/chunks/{index.BMXTnDNz.js → index.UpGiHP7g.js} +26 -25
  16. package/dist/chunks/{init-forks.UV3ZQGQH.js → init-forks.H5ZuobOQ.js} +1 -1
  17. package/dist/chunks/{init-threads.D3eCsY76.js → init-threads.6kl1khcL.js} +1 -1
  18. package/dist/chunks/{init.D98-gwRW.js → init.k9zZ9sLh.js} +1 -1
  19. package/dist/chunks/{nativeModuleMocker.BRN2oBJd.js → nativeModuleMocker.BkNfQMkH.js} +1 -1
  20. package/dist/chunks/{plugin.d.CEihBODF.d.ts → plugin.d.DwFIiJ7i.d.ts} +1 -1
  21. package/dist/chunks/{reporters.d.BwkR0iL5.d.ts → reporters.d.DtoKVV2s.d.ts} +85 -20
  22. package/dist/chunks/{rpc.d.BFMWpdph.d.ts → rpc.d.B_8sPU0w.d.ts} +2 -44
  23. package/dist/chunks/{setup-common.BDwxwUWG.js → setup-common.DYx3LtFI.js} +1 -1
  24. package/dist/chunks/{startVitestModuleRunner.bRl2_oI_.js → startVitestModuleRunner.DB-7oCpn.js} +10 -5
  25. package/dist/chunks/{test.D1JkM1w4.js → test.DNmyFkvJ.js} +1 -1
  26. package/dist/chunks/traces.d.D2T_R8rx.d.ts +60 -0
  27. package/dist/chunks/{vm.DVLYObm9.js → vm.CXMd5FHa.js} +2 -2
  28. package/dist/chunks/{worker.d.CckNUvI5.d.ts → worker.d.ZpHpO4yb.d.ts} +2 -2
  29. package/dist/cli.js +1 -1
  30. package/dist/config.d.ts +10 -10
  31. package/dist/coverage.d.ts +8 -7
  32. package/dist/coverage.js +1 -1
  33. package/dist/index.d.ts +15 -12
  34. package/dist/index.js +2 -2
  35. package/dist/module-evaluator.d.ts +2 -2
  36. package/dist/node.d.ts +10 -10
  37. package/dist/node.js +6 -6
  38. package/dist/reporters.d.ts +8 -8
  39. package/dist/reporters.js +2 -2
  40. package/dist/runners.d.ts +2 -2
  41. package/dist/runners.js +1 -1
  42. package/dist/runtime.js +1 -1
  43. package/dist/worker.d.ts +4 -4
  44. package/dist/worker.js +7 -7
  45. package/dist/workers/forks.js +8 -8
  46. package/dist/workers/runVmTests.js +4 -4
  47. package/dist/workers/threads.js +8 -8
  48. package/dist/workers/vmForks.js +4 -4
  49. package/dist/workers/vmThreads.js +4 -4
  50. package/package.json +52 -32
  51. package/dist/chunks/traces.d.402V_yFI.d.ts +0 -18
package/README.md CHANGED
@@ -13,20 +13,25 @@ npm install @depup/vitest
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [vitest](https://www.npmjs.com/package/vitest) @ 4.1.4 |
17
- | Processed | 2026-04-09 |
16
+ | Original | [vitest](https://www.npmjs.com/package/vitest) @ 4.1.10 |
17
+ | Processed | 2026-07-21 |
18
18
  | Smoke test | passed |
19
- | Deps updated | 6 |
19
+ | Deps updated | 11 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | picomatch | ^4.0.3 | ^4.0.4 |
26
- | tinybench | ^2.9.0 | ^6.0.0 |
27
- | tinyexec | ^1.0.2 | ^1.1.1 |
28
- | tinyglobby | ^0.2.15 | ^0.2.16 |
29
- | vite | ^6.0.0 || ^7.0.0 || ^8.0.0 | ^8.0.8 |
25
+ | es-module-lexer | ^2.0.0 | ^2.3.1 |
26
+ | expect-type | ^1.3.0 | ^1.4.0 |
27
+ | magic-string | ^0.30.21 | ^1.0.0 |
28
+ | obug | ^2.1.1 | ^2.1.4 |
29
+ | picomatch | ^4.0.3 | ^4.0.5 |
30
+ | std-env | ^4.0.0-rc.1 | ^4.2.0 |
31
+ | tinybench | ^2.9.0 | ^6.0.2 |
32
+ | tinyexec | ^1.0.2 | ^1.2.4 |
33
+ | tinyglobby | ^0.2.15 | ^0.2.17 |
34
+ | vite | ^6.0.0 || ^7.0.0 || ^8.0.0 | ^8.1.5 |
30
35
  | why-is-node-running | ^2.3.0 | ^3.2.2 |
31
36
 
32
37
  ---
package/changes.json CHANGED
@@ -1,30 +1,50 @@
1
1
  {
2
2
  "bumped": {
3
+ "es-module-lexer": {
4
+ "from": "^2.0.0",
5
+ "to": "^2.3.1"
6
+ },
7
+ "expect-type": {
8
+ "from": "^1.3.0",
9
+ "to": "^1.4.0"
10
+ },
11
+ "magic-string": {
12
+ "from": "^0.30.21",
13
+ "to": "^1.0.0"
14
+ },
15
+ "obug": {
16
+ "from": "^2.1.1",
17
+ "to": "^2.1.4"
18
+ },
3
19
  "picomatch": {
4
20
  "from": "^4.0.3",
5
- "to": "^4.0.4"
21
+ "to": "^4.0.5"
22
+ },
23
+ "std-env": {
24
+ "from": "^4.0.0-rc.1",
25
+ "to": "^4.2.0"
6
26
  },
7
27
  "tinybench": {
8
28
  "from": "^2.9.0",
9
- "to": "^6.0.0"
29
+ "to": "^6.0.2"
10
30
  },
11
31
  "tinyexec": {
12
32
  "from": "^1.0.2",
13
- "to": "^1.1.1"
33
+ "to": "^1.2.4"
14
34
  },
15
35
  "tinyglobby": {
16
36
  "from": "^0.2.15",
17
- "to": "^0.2.16"
37
+ "to": "^0.2.17"
18
38
  },
19
39
  "vite": {
20
40
  "from": "^6.0.0 || ^7.0.0 || ^8.0.0",
21
- "to": "^8.0.8"
41
+ "to": "^8.1.5"
22
42
  },
23
43
  "why-is-node-running": {
24
44
  "from": "^2.3.0",
25
45
  "to": "^3.2.2"
26
46
  }
27
47
  },
28
- "timestamp": "2026-04-09T08:38:38.208Z",
29
- "totalUpdated": 6
48
+ "timestamp": "2026-07-21T16:26:13.824Z",
49
+ "totalUpdated": 11
30
50
  }
package/dist/browser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.ChUh6-ad.js';
1
+ import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.A1h_Y6Jt.js';
2
2
  import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
3
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
4
- export { O as OTELCarrier, T as Traces } from './chunks/traces.d.402V_yFI.js';
4
+ export { O as OTELCarrier, T as Traces } from './chunks/traces.d.D2T_R8rx.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 };
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.BDwxwUWG.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.DYx3LtFI.js';
2
2
  export { T as Traces } from './chunks/traces.DT5aQ62U.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.C3MK_gXn.js';
4
- import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.D98-gwRW.js';
3
+ import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.DXx9Dtk7.js';
4
+ import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.k9zZ9sLh.js';
5
5
  import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
6
6
  import { T as Traces } from './traces.DT5aQ62U.js';
7
7
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
8
- import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.bRl2_oI_.js';
8
+ import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.DB-7oCpn.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.BDwxwUWG.js';
12
- import { g as globalExpect, v as vi } from './test.D1JkM1w4.js';
11
+ import { s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker } from './setup-common.DYx3LtFI.js';
12
+ import { g as globalExpect, v as vi } from './test.DNmyFkvJ.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.C-zNJvRx.js';
19
+ import { i as index } from './index.DdgEv5B1.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
@@ -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.BRN2oBJd.js');
118
+ const { NativeModuleMocker } = await import('./nativeModuleMocker.BkNfQMkH.js');
119
119
  mocker = new NativeModuleMocker({
120
120
  async resolveId(id, importer) {
121
121
  // TODO: use import.meta.resolve instead
@@ -1,6 +1,6 @@
1
1
  import { FileSpecification } from '@vitest/runner';
2
- import { O as OTELCarrier } from './traces.d.402V_yFI.js';
3
- import { T as TestExecutionMethod } from './worker.d.CckNUvI5.js';
2
+ import { O as OTELCarrier } from './traces.d.D2T_R8rx.js';
3
+ import { T as TestExecutionMethod } from './worker.d.ZpHpO4yb.js';
4
4
 
5
5
  type SerializedTestSpecification = [project: {
6
6
  name: string | undefined;
@@ -621,7 +621,7 @@ class CAC extends EventEmitter {
621
621
 
622
622
  const cac = (name = "") => new CAC(name);
623
623
 
624
- var version = "4.1.4";
624
+ var version = "4.1.10";
625
625
 
626
626
  const apiConfig = (port) => ({
627
627
  port: {
@@ -701,7 +701,7 @@ const cliOptionsConfig = {
701
701
  hideSkippedTests: { description: "Hide logs for skipped tests" },
702
702
  reporters: {
703
703
  alias: "reporter",
704
- description: `Specify reporters (default, agent, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)`,
704
+ description: `Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)`,
705
705
  argument: "<name>",
706
706
  subcommands: null,
707
707
  array: true
@@ -2336,7 +2336,7 @@ function normalizeCliOptions(cliFilters, argv) {
2336
2336
  }
2337
2337
  async function start(mode, cliFilters, options) {
2338
2338
  try {
2339
- const { startVitest } = await import('./cli-api.lDy4N9kC.js').then(function (n) { return n.q; });
2339
+ const { startVitest } = await import('./cli-api.BK8pd4xc.js').then(function (n) { return n.q; });
2340
2340
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
2341
2341
  if (!ctx.shouldKeepServer()) await ctx.exit();
2342
2342
  } catch (e) {
@@ -2358,7 +2358,7 @@ async function init(project) {
2358
2358
  }
2359
2359
  async function collect(mode, cliFilters, options) {
2360
2360
  try {
2361
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.lDy4N9kC.js').then(function (n) { return n.q; });
2361
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BK8pd4xc.js').then(function (n) { return n.q; });
2362
2362
  const ctx = await prepareVitest(mode, {
2363
2363
  ...normalizeCliOptions(cliFilters, options),
2364
2364
  watch: false,
@@ -13,13 +13,13 @@ import nodeos__default, { tmpdir } from 'node:os';
13
13
  import { generateHash as generateHash$1, createTaskName, validateTags, calculateSuiteHash, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, createTagsFilter, someTasksAreOnly, interpretTaskModes, getTasks, isTestCase } from '@vitest/runner/utils';
14
14
  import { SnapshotManager } from '@vitest/snapshot/manager';
15
15
  import { serializeValue } from '@vitest/utils/serialize';
16
- import { v as version$1 } from './cac.wyYWMVI-.js';
16
+ import { v as version$1 } from './cac.DdICfEr1.js';
17
17
  import { rootDir, distDir } from '../path.js';
18
- import { f as createIndexLocationsMap, g as TraceMap, o as originalPositionFor, h as ancestor, s as stringify, p as parse, i as printError, j as Typechecker, k as generateCodeFrame, l as escapeRegExp, m as createDefinesScript, a as BenchmarkReportsMap, R as ReportersMap, n as groupBy, q as BlobReporter, r as readBlobs, t as convertTasksToEvents, H as HangingProcessReporter, w as wildcardPatternToRegExp, u as stdout } from './index.BMXTnDNz.js';
18
+ import { f as createIndexLocationsMap, g as TraceMap, o as originalPositionFor, h as ancestor, s as stringify, p as parse, i as printError, j as Typechecker, k as generateCodeFrame, l as escapeRegExp, m as createDefinesScript, a as BenchmarkReportsMap, R as ReportersMap, n as groupBy, q as BlobReporter, r as readBlobs, t as convertTasksToEvents, H as HangingProcessReporter, w as wildcardPatternToRegExp, u as stdout } from './index.UpGiHP7g.js';
19
19
  import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
20
20
  import { T as Traces } from './traces.DT5aQ62U.js';
21
21
  import { createDebug } from 'obug';
22
- import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.Da5gzbsu.js';
22
+ import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.DM_a_rWm.js';
23
23
  import { rm, readFile, writeFile, rename, stat, unlink, mkdir, copyFile } from 'node:fs/promises';
24
24
  import c from 'tinyrainbow';
25
25
  import { VitestModuleEvaluator } from '#module-evaluator';
@@ -137,7 +137,7 @@ function astParseFile(filepath, code) {
137
137
  if (callee.type === "TaggedTemplateExpression") return getName(callee.tag);
138
138
  if (callee.type === "MemberExpression") {
139
139
  if (callee.object?.type === "Identifier" && isVitestFunctionName(callee.object.name)) return callee.object?.name;
140
- if (callee.object?.name?.startsWith("__vite_ssr_") || callee.object?.object?.name?.startsWith("__vite_ssr_") && callee.object?.property?.name === "Vitest") return getName(callee.property);
140
+ if (callee.object?.name?.startsWith("__vite_ssr_") || callee.object?.name?.startsWith("__vi_import_") || callee.object?.object?.name?.startsWith("__vite_ssr_") && callee.object?.property?.name === "Vitest") return getName(callee.property);
141
141
  // call as `__vite_ssr__.test.skip()` or `describe.concurrent.each()`
142
142
  return getName(callee.object);
143
143
  }
@@ -456,17 +456,29 @@ class BrowserSessions {
456
456
  destroySession(sessionId) {
457
457
  this.sessions.delete(sessionId);
458
458
  }
459
- createSession(sessionId, project, pool) {
460
- // this promise only waits for the WS connection with the orchestrator to be established
459
+ createSession(sessionId, project, pool, options) {
460
+ // this promise waits until the orchestrator is ready to accept RPC calls
461
461
  const defer = createDefer();
462
+ let isConnected = false;
463
+ let isReady = false;
462
464
  const timeout = setTimeout(() => {
463
465
  defer.reject(/* @__PURE__ */ new Error(`Failed to connect to the browser session "${sessionId}" [${project.name}] within the timeout.`));
464
466
  }, project.vitest.config.browser.connectTimeout ?? 6e4).unref();
467
+ const resolveIfReady = () => {
468
+ if (!isConnected || !isReady) return;
469
+ defer.resolve();
470
+ clearTimeout(timeout);
471
+ };
465
472
  this.sessions.set(sessionId, {
466
473
  project,
474
+ otelCarrier: options?.otelCarrier,
467
475
  connected: () => {
468
- defer.resolve();
469
- clearTimeout(timeout);
476
+ isConnected = true;
477
+ resolveIfReady();
478
+ },
479
+ ready: () => {
480
+ isReady = true;
481
+ resolveIfReady();
470
482
  },
471
483
  fail: (error) => {
472
484
  defer.resolve();
@@ -3009,6 +3021,7 @@ class PoolRunner {
3009
3021
  };
3010
3022
  emitUnexpectedExit = () => {
3011
3023
  const error = /* @__PURE__ */ new Error("Worker exited unexpectedly");
3024
+ this._state = RunnerState.STOPPED;
3012
3025
  this._eventEmitter.emit("error", error);
3013
3026
  };
3014
3027
  waitForStart() {
@@ -3436,14 +3449,18 @@ class Pool {
3436
3449
  if (task.memoryLimit && message.usedMemory) isMemoryLimitReached = message.usedMemory >= task.memoryLimit;
3437
3450
  if (message.error) this.options.state.catchError(message.error, "Test Run Error");
3438
3451
  runner.off("message", onFinished);
3452
+ runner.off("error", onTaskError);
3439
3453
  resolver.resolve();
3440
3454
  }
3441
3455
  };
3456
+ function onTaskError(error) {
3457
+ runner.off("message", onFinished);
3458
+ runner.off("error", onTaskError);
3459
+ resolver.reject(new Error(`[vitest-pool]: Worker ${task.worker} emitted error.`, { cause: error }));
3460
+ }
3442
3461
  runner.on("message", onFinished);
3462
+ runner.on("error", onTaskError);
3443
3463
  if (!runner.isStarted) {
3444
- runner.on("error", (error) => {
3445
- resolver.reject(new Error(`[vitest-pool]: Worker ${task.worker} emitted error.`, { cause: error }));
3446
- });
3447
3464
  const id = setTimeout(() => resolver.reject(/* @__PURE__ */ new Error(`[vitest-pool]: Timeout starting ${task.worker} runner.`)), WORKER_START_TIMEOUT);
3448
3465
  await runner.start({ workerId: task.context.workerId }).catch((error) => resolver.reject(new Error(`[vitest-pool]: Failed to start ${task.worker} worker for test files ${formatFiles(task)}.`, { cause: error }))).finally(() => clearTimeout(id));
3449
3466
  }
@@ -3456,7 +3473,7 @@ class Pool {
3456
3473
  await resolver.promise.catch((error) => span?.recordException(error)).finally(() => span?.end());
3457
3474
  const index = this.activeTasks.indexOf(activeTask);
3458
3475
  if (index !== -1) this.activeTasks.splice(index, 1);
3459
- if (!task.isolate && !isMemoryLimitReached && this.queue[0]?.task.isolate === false && isEqualRunner(runner, this.queue[0].task)) {
3476
+ if (!task.isolate && !runner.isTerminated && !isMemoryLimitReached && this.queue[0]?.task.isolate === false && isEqualRunner(runner, this.queue[0].task)) {
3460
3477
  this.sharedRunners.push(runner);
3461
3478
  return this.schedule();
3462
3479
  }
@@ -8971,7 +8988,7 @@ function setup(ctx, _server) {
8971
8988
  await ctx.rerunTask(id);
8972
8989
  },
8973
8990
  getConfig() {
8974
- return ctx.getRootProject().serializedConfig;
8991
+ return ctx.serializedRootConfig;
8975
8992
  },
8976
8993
  getResolvedProjectLabels() {
8977
8994
  return ctx.projects.map((p) => ({
@@ -9170,6 +9187,7 @@ function serializeConfig(project) {
9170
9187
  disableConsoleIntercept: config.disableConsoleIntercept,
9171
9188
  root: config.root,
9172
9189
  name: config.name,
9190
+ color: config.color,
9173
9191
  globals: config.globals,
9174
9192
  snapshotEnvironment: config.snapshotEnvironment,
9175
9193
  passWithNoTests: config.passWithNoTests,
@@ -10949,9 +10967,8 @@ class TestProject {
10949
10967
  const url = new URL("/__vitest_test__/", origin);
10950
10968
  url.searchParams.set("sessionId", sessionId);
10951
10969
  const otelCarrier = this.vitest._traces.getContextCarrier();
10952
- if (otelCarrier) url.searchParams.set("otelCarrier", JSON.stringify(otelCarrier));
10953
10970
  this.vitest._browserSessions.sessionIds.add(sessionId);
10954
- const sessionPromise = this.vitest._browserSessions.createSession(sessionId, this, pool);
10971
+ const sessionPromise = this.vitest._browserSessions.createSession(sessionId, this, pool, { otelCarrier });
10955
10972
  const pagePromise = this.browser.provider.openPage(sessionId, url.toString(), { parallel: pool.parallel ?? false });
10956
10973
  await Promise.all([sessionPromise, pagePromise]);
10957
10974
  }
@@ -11173,13 +11190,14 @@ async function resolveBrowserProjects(vitest, names, resolvedProjects) {
11173
11190
  const removeProjects = /* @__PURE__ */ new Set();
11174
11191
  resolvedProjects.forEach((project) => {
11175
11192
  if (!project.config.browser.enabled) return;
11193
+ const originalName = project.config.name;
11176
11194
  const instances = project.config.browser.instances || [];
11177
- if (instances.length === 0) {
11195
+ if (instances.length === 0 || vitest.isExcludedByProjectFilter(originalName)) {
11178
11196
  removeProjects.add(project);
11179
11197
  return;
11180
11198
  }
11181
- const originalName = project.config.name;
11182
- // if original name is in the --project=name filter, keep all instances
11199
+ // if original name matches a positive filter, keep all instances
11200
+ // otherwise, filter instances individually (user may target a specific instance name)
11183
11201
  const filteredInstances = vitest.matchesProjectFilter(originalName) ? instances : instances.filter((instance) => {
11184
11202
  const newName = instance.name;
11185
11203
  return vitest.matchesProjectFilter(newName);
@@ -13248,6 +13266,12 @@ class Vitest {
13248
13266
  if (!this.coreWorkspaceProject) throw new Error(`Root project is not initialized. This means that the Vite server was not established yet and the the workspace config is not resolved.`);
13249
13267
  return this.coreWorkspaceProject;
13250
13268
  }
13269
+ get serializedRootConfig() {
13270
+ return {
13271
+ ...this.getRootProject().serializedConfig,
13272
+ projects: this.projects.map((project) => project.serializedConfig)
13273
+ };
13274
+ }
13251
13275
  getProjectByName(name) {
13252
13276
  const project = this.projects.find((p) => p.name === name) || this.coreWorkspaceProject || this.projects[0];
13253
13277
  if (!project) throw new Error(`Project "${name}" was not found.`);
@@ -14025,6 +14049,15 @@ class Vitest {
14025
14049
  return wildcardPatternToRegExp(project).test(name);
14026
14050
  });
14027
14051
  }
14052
+ /** @internal */
14053
+ isExcludedByProjectFilter(name) {
14054
+ const projects = this._config?.project || this._cliOptions?.project;
14055
+ if (!projects || !projects.length) return false;
14056
+ return toArray(projects).some((project) => {
14057
+ if (!project.startsWith("!")) return false;
14058
+ return wildcardPatternToRegExp(project.slice(1)).test(name);
14059
+ });
14060
+ }
14028
14061
  }
14029
14062
  function assert(condition, property, name = property) {
14030
14063
  if (!condition) throw new Error(`The ${name} was not set. It means that \`vitest.${property}\` was called before the Vite server was established. Await the Vitest promise before accessing \`vitest.${property}\`.`);
@@ -2,6 +2,7 @@ import { PrettyFormatOptions } from '@vitest/pretty-format';
2
2
  import { SequenceHooks, SequenceSetupFiles, SerializableRetry, TestTagDefinition } from '@vitest/runner';
3
3
  import { SnapshotUpdateState, SnapshotEnvironment } from '@vitest/snapshot';
4
4
  import { SerializedDiffOptions } from '@vitest/utils/diff';
5
+ import { L as LabelColor } from './traces.d.D2T_R8rx.js';
5
6
 
6
7
  /**
7
8
  * Names of clock methods that may be faked by install.
@@ -69,6 +70,7 @@ interface FakeTimerInstallOpts {
69
70
  */
70
71
  interface SerializedConfig {
71
72
  name: string | undefined;
73
+ color?: LabelColor;
72
74
  globals: boolean;
73
75
  base: string | undefined;
74
76
  snapshotEnvironment?: string;
@@ -216,6 +218,9 @@ interface SerializedCoverageConfig {
216
218
  enabled: boolean;
217
219
  customProviderModule: string | undefined;
218
220
  }
221
+ interface SerializedRootConfig extends SerializedConfig {
222
+ projects: SerializedConfig[];
223
+ }
219
224
  type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookTimeout" | "clearMocks" | "mockReset" | "restoreMocks" | "fakeTimers" | "maxConcurrency" | "expect" | "printConsoleTrace"> & {
220
225
  sequence?: {
221
226
  hooks?: SequenceHooks;
@@ -224,4 +229,4 @@ type RuntimeConfig = Pick<SerializedConfig, "allowOnly" | "testTimeout" | "hookT
224
229
  type RuntimeOptions = Partial<RuntimeConfig>;
225
230
  type BrowserTraceViewMode = "on" | "off" | "on-first-retry" | "on-all-retries" | "retain-on-failure";
226
231
 
227
- export type { BrowserTraceViewMode as B, FakeTimerInstallOpts as F, RuntimeOptions as R, SerializedConfig as S, SerializedCoverageConfig as a, RuntimeConfig as b };
232
+ export type { BrowserTraceViewMode as B, FakeTimerInstallOpts as F, RuntimeOptions as R, SerializedConfig as S, SerializedCoverageConfig as a, SerializedRootConfig as b, RuntimeConfig as c };
@@ -725,6 +725,10 @@ Update your dependencies and make sure the versions match.`));
725
725
  this.coverageFiles = /* @__PURE__ */ new Map();
726
726
  this.pendingPromises = [];
727
727
  }
728
+ normalizeCoverageFileError(error) {
729
+ if (error instanceof Error && "code" in error && error.code === "ENOENT" && !existsSync(this.coverageFilesDirectory)) return new Error(`Something removed the coverage directory "${this.coverageFilesDirectory}" Vitest created earlier. Make sure you are not running multiple Vitests with the same "coverage.reportsDirectory" at the same time.`, { cause: error });
730
+ return error;
731
+ }
728
732
  onAfterSuiteRun({ coverage, environment, projectName, testFiles }) {
729
733
  if (!coverage) return;
730
734
  let entry = this.coverageFiles.get(projectName || DEFAULT_PROJECT);
@@ -737,7 +741,9 @@ Update your dependencies and make sure the versions match.`));
737
741
  entry[environment] ??= {};
738
742
  // If there's a result from previous run, overwrite it
739
743
  entry[environment][testFilenames] = filename;
740
- const promise = promises.writeFile(filename, JSON.stringify(coverage), "utf-8");
744
+ const promise = promises.writeFile(filename, JSON.stringify(coverage), "utf-8").catch((error) => {
745
+ throw this.normalizeCoverageFileError(error);
746
+ });
741
747
  this.pendingPromises.push(promise);
742
748
  }
743
749
  async readCoverageFiles({ onFileRead, onFinished, onDebug }) {
@@ -754,7 +760,9 @@ Update your dependencies and make sure the versions match.`));
754
760
  onDebug(`Reading coverage results ${index}/${total}`);
755
761
  }
756
762
  await Promise.all(chunk.map(async (filename) => {
757
- const contents = await promises.readFile(filename, "utf-8");
763
+ const contents = await promises.readFile(filename, "utf-8").catch((error) => {
764
+ throw this.normalizeCoverageFileError(error);
765
+ });
758
766
  onFileRead(JSON.parse(contents));
759
767
  }));
760
768
  }
@@ -3,7 +3,7 @@ import { Plugin } from '@vitest/pretty-format';
3
3
  import { Test } from '@vitest/runner';
4
4
  import { SnapshotState } from '@vitest/snapshot';
5
5
  import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js';
6
- import { U as UserConsoleLog } from './rpc.d.BFMWpdph.js';
6
+ import { U as UserConsoleLog } from './traces.d.D2T_R8rx.js';
7
7
 
8
8
  interface SnapshotMatcher<T> {
9
9
  <U extends { [P in keyof T] : any }>(snapshot: Partial<U>, hint?: string): void;
@@ -1,6 +1,6 @@
1
1
  import { g as globalApis } from './constants.CPYnjOGj.js';
2
- import { i as index } from './index.C-zNJvRx.js';
3
- import './test.D1JkM1w4.js';
2
+ import { i as index } from './index.DdgEv5B1.js';
3
+ import './test.DNmyFkvJ.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/utils/helpers';
6
6
  import '@vitest/utils/timers';
@@ -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.BDwxwUWG.js';
3
+ import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.DYx3LtFI.js';
4
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.D1JkM1w4.js';
6
+ import { T as TestRunner, N as NodeBenchmarkRunner } from './test.DNmyFkvJ.js';
7
7
 
8
8
  function setupChaiConfig(config) {
9
9
  Object.assign(chai.config, config);
@@ -1,4 +1,4 @@
1
- import { v as vi, N as NodeBenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, c as createExpect, g as globalExpect, i as inject, s as should, b as vitest } from './test.D1JkM1w4.js';
1
+ import { v as vi, N as NodeBenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, c as createExpect, g as globalExpect, i as inject, s as should, b as vitest } from './test.DNmyFkvJ.js';
2
2
  import { b as bench } from './benchmark.CX_oY03V.js';
3
3
  import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
4
4
  import { expectTypeOf } from 'expect-type';
@@ -6,6 +6,7 @@ import c from 'tinyrainbow';
6
6
  import { t as truncateString, e as errorBanner, F as F_POINTER, d as divider, f as formatTimeString, a as taskFail, s as separator, b as F_CHECK, c as F_DOWN_RIGHT, g as formatProjectName, h as getStateSymbol, w as withLabel, r as renderSnapshotSummary, p as padSummaryTitle, i as getStateString$1, j as formatTime, k as countTestErrors, l as F_TREE_NODE_END, m as F_TREE_NODE_MIDDLE, n as noun, o as F_RIGHT } from './utils.BS4fH3nR.js';
7
7
  import { stripVTControlCharacters } from 'node:util';
8
8
  import { isPrimitive, toArray, deepMerge, notNullish } from '@vitest/utils/helpers';
9
+ import { readdir, stat, readFile, mkdir, writeFile } from 'node:fs/promises';
9
10
  import { performance as performance$1 } from 'node:perf_hooks';
10
11
  import { defaultStackIgnorePatterns, parseErrorStacktrace, parseStacktrace } from '@vitest/utils/source-map';
11
12
  import { i as isTTY } from './env.D4Lgay0q.js';
@@ -17,7 +18,6 @@ import { x } from 'tinyexec';
17
18
  import { distDir } from '../path.js';
18
19
  import { parseAstAsync } from 'vite';
19
20
  import { positionToOffset, lineSplitRE } from '@vitest/utils/offset';
20
- import { readdir, stat, readFile, mkdir, writeFile } from 'node:fs/promises';
21
21
  import { createRequire } from 'node:module';
22
22
 
23
23
  function groupBy(collection, iteratee) {
@@ -3135,28 +3135,6 @@ class DefaultReporter extends BaseReporter {
3135
3135
  }
3136
3136
  }
3137
3137
 
3138
- class AgentReporter extends DefaultReporter {
3139
- renderSucceed = false;
3140
- constructor(options = {}) {
3141
- super({
3142
- silent: "passed-only",
3143
- ...options,
3144
- summary: false
3145
- });
3146
- }
3147
- onTestRunStart(specifications) {
3148
- super.onTestRunStart(specifications);
3149
- this.renderSucceed = false;
3150
- }
3151
- printTestModule(testModule) {
3152
- if (testModule.state() !== "failed") return;
3153
- super.printTestModule(testModule);
3154
- }
3155
- printTestCase(moduleState, test) {
3156
- if (test.result().state === "failed") super.printTestCase(moduleState, test);
3157
- }
3158
- }
3159
-
3160
3138
  class DotReporter extends BaseReporter {
3161
3139
  renderer;
3162
3140
  tests = /* @__PURE__ */ new Map();
@@ -3886,6 +3864,28 @@ class JUnitReporter {
3886
3864
  }
3887
3865
  }
3888
3866
 
3867
+ class MinimalReporter extends DefaultReporter {
3868
+ renderSucceed = false;
3869
+ constructor(options = {}) {
3870
+ super({
3871
+ silent: "passed-only",
3872
+ ...options,
3873
+ summary: false
3874
+ });
3875
+ }
3876
+ onTestRunStart(specifications) {
3877
+ super.onTestRunStart(specifications);
3878
+ this.renderSucceed = false;
3879
+ }
3880
+ printTestModule(testModule) {
3881
+ if (testModule.state() !== "failed") return;
3882
+ super.printTestModule(testModule);
3883
+ }
3884
+ printTestCase(moduleState, test) {
3885
+ if (test.result().state === "failed") super.printTestCase(moduleState, test);
3886
+ }
3887
+ }
3888
+
3889
3889
  function yamlString(str) {
3890
3890
  if (!str) return "";
3891
3891
  return `"${str.replace(/"/g, "\\\"")}"`;
@@ -4238,7 +4238,8 @@ const BenchmarkReportsMap = {
4238
4238
 
4239
4239
  const ReportersMap = {
4240
4240
  "default": DefaultReporter,
4241
- "agent": AgentReporter,
4241
+ "agent": MinimalReporter,
4242
+ "minimal": MinimalReporter,
4242
4243
  "blob": BlobReporter,
4243
4244
  "verbose": VerboseReporter,
4244
4245
  "dot": DotReporter,
@@ -4251,4 +4252,4 @@ const ReportersMap = {
4251
4252
  "github-actions": GithubActionsReporter
4252
4253
  };
4253
4254
 
4254
- export { AgentReporter as A, BenchmarkReporter as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JUnitReporter as J, ReportersMap as R, TapFlatReporter as T, VerboseBenchmarkReporter as V, BenchmarkReportsMap as a, DotReporter as b, JsonReporter as c, TapReporter as d, VerboseReporter as e, createIndexLocationsMap as f, TraceMap as g, ancestor as h, printError as i, Typechecker as j, generateCodeFrame as k, escapeRegExp as l, createDefinesScript as m, groupBy as n, originalPositionFor as o, parse as p, BlobReporter as q, readBlobs as r, stringify as s, convertTasksToEvents as t, stdout as u, wildcardPatternToRegExp as w };
4255
+ export { BenchmarkReporter as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JUnitReporter as J, MinimalReporter as M, ReportersMap as R, TapFlatReporter as T, VerboseBenchmarkReporter as V, BenchmarkReportsMap as a, DotReporter as b, JsonReporter as c, TapReporter as d, VerboseReporter as e, createIndexLocationsMap as f, TraceMap as g, ancestor as h, printError as i, Typechecker as j, generateCodeFrame as k, escapeRegExp as l, createDefinesScript as m, groupBy as n, originalPositionFor as o, parse as p, BlobReporter as q, readBlobs as r, stringify as s, convertTasksToEvents as t, stdout as u, wildcardPatternToRegExp as w };
@@ -1,4 +1,4 @@
1
- import { i as init } from './init.D98-gwRW.js';
1
+ import { i as init } from './init.k9zZ9sLh.js';
2
2
 
3
3
  if (!process.send) throw new Error("Expected worker to be run in node:child_process");
4
4
  // Store globals in case tests overwrite them
@@ -1,5 +1,5 @@
1
1
  import { isMainThread, parentPort } from 'node:worker_threads';
2
- import { i as init } from './init.D98-gwRW.js';
2
+ import { i as init } from './init.k9zZ9sLh.js';
3
3
 
4
4
  if (isMainThread || !parentPort) throw new Error("Expected worker to be run in node:worker_threads");
5
5
  function workerInit(options) {
@@ -3,7 +3,7 @@ import { isBuiltin } from 'node:module';
3
3
  import { pathToFileURL } from 'node:url';
4
4
  import { resolve } from 'pathe';
5
5
  import { ModuleRunner, EvaluatedModules } from 'vite/module-runner';
6
- import { b as VitestTransport } from './startVitestModuleRunner.bRl2_oI_.js';
6
+ import { b as VitestTransport } from './startVitestModuleRunner.DB-7oCpn.js';
7
7
  import { e as environments } from './index.DC7d2Pf8.js';
8
8
  import { serializeValue } from '@vitest/utils/serialize';
9
9
  import { serializeError } from '@vitest/utils/error';
@@ -5,7 +5,7 @@ import { cleanUrl, createDefer } from '@vitest/utils/helpers';
5
5
  import { p as parse } from './acorn.B2iPLyUM.js';
6
6
  import { isAbsolute } from 'pathe';
7
7
  import { t as toBuiltin } from './modules.BJuCwlRJ.js';
8
- import { B as BareModuleMocker, n as normalizeModuleId } from './startVitestModuleRunner.bRl2_oI_.js';
8
+ import { B as BareModuleMocker, n as normalizeModuleId } from './startVitestModuleRunner.DB-7oCpn.js';
9
9
  import 'node:fs';
10
10
  import './utils.BX5Fg8C4.js';
11
11
  import '@vitest/utils/timers';
@@ -1,5 +1,5 @@
1
1
  import { DevEnvironment } from 'vite';
2
- import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.BwkR0iL5.js';
2
+ import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.DtoKVV2s.js';
3
3
 
4
4
  /**
5
5
  * Generate a unique cache identifier.