vitest 3.2.4 → 3.2.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.
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.D2ROskhv.js';
1
+ import { S as SerializedCoverageConfig, a as SerializedConfig } from './chunks/config.d.BKdhh7Zx.js';
2
2
  import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.S9RMNXIe.js';
3
3
  import { SerializedDiffOptions } from '@vitest/utils/diff';
4
4
  import { VitestExecutor } from './execute.js';
@@ -12,7 +12,7 @@ import '@vitest/snapshot';
12
12
  import '@vitest/snapshot/environment';
13
13
  import 'vite-node/client';
14
14
  import 'vite-node';
15
- import './chunks/worker.d.1GmBbd7G.js';
15
+ import './chunks/worker.d.CUgIPz9V.js';
16
16
  import './chunks/environment.d.cL3nLXbE.js';
17
17
  import 'vitest/optional-types.js';
18
18
  import 'node:vm';
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
619
619
 
620
620
  const cac = (name = "") => new CAC(name);
621
621
 
622
- var version = "3.2.4";
622
+ var version = "3.2.6";
623
623
 
624
624
  const apiConfig = (port) => ({
625
625
  port: {
@@ -631,6 +631,8 @@ const apiConfig = (port) => ({
631
631
  argument: "[host]"
632
632
  },
633
633
  strictPort: { description: "Set to true to exit if port is already in use, instead of automatically trying the next available port" },
634
+ allowExec: { description: "Allow API to execute code. (Be careful when enabling this option in untrusted environments)" },
635
+ allowWrite: { description: "Allow API to edit files. (Be careful when enabling this option in untrusted environments)" },
634
636
  middlewareMode: null
635
637
  });
636
638
  const poolThreadsCommands = {
@@ -1408,7 +1410,7 @@ async function start(mode, cliFilters, options) {
1408
1410
  process.title = "node (vitest)";
1409
1411
  } catch {}
1410
1412
  try {
1411
- const { startVitest } = await import('./cli-api.BkDphVBG.js').then(function (n) { return n.f; });
1413
+ const { startVitest } = await import('./cli-api.DWGBtMmz.js').then(function (n) { return n.f; });
1412
1414
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1413
1415
  if (!ctx.shouldKeepServer()) await ctx.exit();
1414
1416
  } catch (e) {
@@ -1433,7 +1435,7 @@ async function collect(mode, cliFilters, options) {
1433
1435
  process.title = "node (vitest)";
1434
1436
  } catch {}
1435
1437
  try {
1436
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.BkDphVBG.js').then(function (n) { return n.f; });
1438
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DWGBtMmz.js').then(function (n) { return n.f; });
1437
1439
  const ctx = await prepareVitest(mode, {
1438
1440
  ...normalizeCliOptions(cliFilters, options),
1439
1441
  watch: false,
@@ -11,7 +11,7 @@ import { generateFileHash, limitConcurrency, createFileTask, hasFailed, getTasks
11
11
  import { SnapshotManager } from '@vitest/snapshot/manager';
12
12
  import { ViteNodeRunner } from 'vite-node/client';
13
13
  import { ViteNodeServer } from 'vite-node/server';
14
- import { v as version$1 } from './cac.Cb-PYCCB.js';
14
+ import { v as version$1 } from './cac.0BJqEUeA.js';
15
15
  import { c as createBirpc } from './index.B521nVV-.js';
16
16
  import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, j as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.VByaPkjc.js';
17
17
  import require$$0$3 from 'events';
@@ -28,7 +28,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
28
28
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
29
29
  import crypto, { createHash } from 'node:crypto';
30
30
  import { distDir, rootDir } from '../path.js';
31
- import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.DL5VHqXY.js';
31
+ import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.DfSpMS-b.js';
32
32
  import { c as convertTasksToEvents } from './typechecker.DRKU1-1g.js';
33
33
  import { Console } from 'node:console';
34
34
  import c from 'tinyrainbow';
@@ -5109,12 +5109,15 @@ function setup(ctx, _server) {
5109
5109
  },
5110
5110
  async saveTestFile(id, content) {
5111
5111
  if (!ctx.state.filesMap.has(id) || !existsSync(id)) throw new Error(`Test file "${id}" was not registered, so it cannot be updated using the API.`);
5112
+ if (!ctx.config.api.allowWrite) return;
5112
5113
  return promises.writeFile(id, content, "utf-8");
5113
5114
  },
5114
5115
  async rerun(files, resetTestNamePattern) {
5116
+ if (!ctx.config.api.allowExec) return;
5115
5117
  await ctx.rerunFiles(files, void 0, true, resetTestNamePattern);
5116
5118
  },
5117
5119
  async rerunTask(id) {
5120
+ if (!ctx.config.api.allowExec) return;
5118
5121
  await ctx.rerunTask(id);
5119
5122
  },
5120
5123
  getConfig() {
@@ -5143,6 +5146,7 @@ function setup(ctx, _server) {
5143
5146
  return getModuleGraph(ctx, project, id, browser);
5144
5147
  },
5145
5148
  async updateSnapshot(file) {
5149
+ if (!ctx.config.api.allowExec || !ctx.config.api.allowWrite) return;
5146
5150
  if (!file) await ctx.updateSnapshot();
5147
5151
  else await ctx.updateSnapshot([file.filepath]);
5148
5152
  },
@@ -5705,6 +5709,12 @@ function serializeConfig(config, coreConfig, viteConfig) {
5705
5709
  pool: config.pool,
5706
5710
  expect: config.expect,
5707
5711
  snapshotSerializers: config.snapshotSerializers,
5712
+ api: ((api) => {
5713
+ return {
5714
+ allowExec: api?.allowExec,
5715
+ allowWrite: api?.allowWrite
5716
+ };
5717
+ })(config.browser.enabled ? config.browser.api : config.api),
5708
5718
  diff: config.diff,
5709
5719
  retry: config.retry,
5710
5720
  disableConsoleIntercept: config.disableConsoleIntercept,
@@ -162,6 +162,10 @@ interface SerializedConfig {
162
162
  showDiff?: boolean
163
163
  truncateThreshold?: number
164
164
  } | undefined;
165
+ api: {
166
+ allowExec: boolean | undefined
167
+ allowWrite: boolean | undefined
168
+ };
165
169
  diff: string | SerializedDiffOptions | undefined;
166
170
  retry: number;
167
171
  includeTaskLocation: boolean | undefined;
@@ -3514,7 +3514,7 @@ function parseInspector(inspect) {
3514
3514
  port: Number(port) || defaultInspectPort
3515
3515
  };
3516
3516
  }
3517
- function resolveApiServerConfig(options, defaultPort) {
3517
+ function resolveApiServerConfig(options, defaultPort, parentApi, logger) {
3518
3518
  let api;
3519
3519
  if (options.ui && !options.api) api = { port: defaultPort };
3520
3520
  else if (options.api === true) api = { port: defaultPort };
@@ -3527,6 +3527,14 @@ function resolveApiServerConfig(options, defaultPort) {
3527
3527
  if (api) {
3528
3528
  if (!api.port && !api.middlewareMode) api.port = defaultPort;
3529
3529
  } else api = { middlewareMode: true };
3530
+ if (!api.middlewareMode && api.host && api.host !== "localhost" && api.host !== "127.0.0.1") {
3531
+ if (parentApi && api.allowWrite == null && api.allowExec == null) logger?.error(c.yellow(`${c.yellowBright(" WARNING ")} API server is exposed to network, disabling write and exec operations by default for security reasons. This can cause some APIs to not work as expected. Set \`browser.api.allowExec\` manually to hide this warning. See https://vitest.dev/config/browser/api for more details.`));
3532
+ api.allowWrite ??= parentApi?.allowWrite ?? false;
3533
+ api.allowExec ??= parentApi?.allowExec ?? false;
3534
+ } else {
3535
+ api.allowWrite ??= parentApi?.allowWrite ?? true;
3536
+ api.allowExec ??= parentApi?.allowExec ?? true;
3537
+ }
3530
3538
  return api;
3531
3539
  }
3532
3540
  function resolveInlineWorkerOption(value) {
@@ -3899,7 +3907,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
3899
3907
  resolved.browser.locators ??= {};
3900
3908
  resolved.browser.locators.testIdAttribute ??= "data-testid";
3901
3909
  if (resolved.browser.enabled && provider === "stackblitz") resolved.browser.provider = "preview";
3902
- resolved.browser.api = resolveApiServerConfig(resolved.browser, defaultBrowserPort) || { port: defaultBrowserPort };
3910
+ resolved.browser.api = resolveApiServerConfig(resolved.browser, defaultBrowserPort, resolved.api, logger) || { port: defaultBrowserPort };
3903
3911
  // enable includeTaskLocation by default in UI mode
3904
3912
  if (resolved.browser.enabled) {
3905
3913
  if (resolved.browser.ui) resolved.includeTaskLocation ??= true;
@@ -6,8 +6,8 @@ import { TransformResult as TransformResult$1, UserConfig as UserConfig$1, DepOp
6
6
  import { Console } from 'node:console';
7
7
  import { MockedModule } from '@vitest/mocker';
8
8
  import { StackTraceParserOptions } from '@vitest/utils/source-map';
9
- import { T as TestExecutionMethod } from './worker.d.1GmBbd7G.js';
10
- import { a as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.D2ROskhv.js';
9
+ import { T as TestExecutionMethod } from './worker.d.CUgIPz9V.js';
10
+ import { a as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.BKdhh7Zx.js';
11
11
  import { PrettyFormatOptions } from '@vitest/pretty-format';
12
12
  import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
13
13
  import { SerializedDiffOptions } from '@vitest/utils/diff';
@@ -1453,7 +1453,20 @@ type BuiltinEnvironment = "node" | "jsdom" | "happy-dom" | "edge-runtime";
1453
1453
  type VitestEnvironment = BuiltinEnvironment | (string & Record<never, never>);
1454
1454
 
1455
1455
  type CSSModuleScopeStrategy = "stable" | "scoped" | "non-scoped";
1456
- type ApiConfig = Pick<ServerOptions, "port" | "strictPort" | "host" | "middlewareMode">;
1456
+ type ApiConfig = Pick<ServerOptions, "port" | "strictPort" | "host" | "middlewareMode"> & {
1457
+ /**
1458
+ * Allow any write operations from the API server.
1459
+ *
1460
+ * @default true if API is not exposed to the network, false otherwise
1461
+ */
1462
+ allowWrite?: boolean
1463
+ /**
1464
+ * Allow running test files via the API.
1465
+ *
1466
+ * @default true if API is not exposed to the network, false otherwise
1467
+ */
1468
+ allowExec?: boolean
1469
+ };
1457
1470
 
1458
1471
  type VitestRunMode = "test" | "benchmark";
1459
1472
  interface ProjectName {
@@ -1,5 +1,5 @@
1
1
  import { HookHandler } from 'vite';
2
- import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.BFLkQcL6.js';
2
+ import { V as Vitest, T as TestProject, b as TestProjectConfiguration, I as InlineConfig } from './reporters.d.BuRON0I0.js';
3
3
 
4
4
  interface VitestPluginContext {
5
5
  vitest: Vitest;
@@ -1,6 +1,6 @@
1
1
  import { File, TestAnnotation, TaskResultPack, TaskEventPack, CancelReason, FileSpecification, Task } from '@vitest/runner';
2
2
  import { ViteNodeResolveId, ModuleCacheMap, ModuleExecutionInfo } from 'vite-node';
3
- import { a as SerializedConfig } from './config.d.D2ROskhv.js';
3
+ import { a as SerializedConfig } from './config.d.BKdhh7Zx.js';
4
4
  import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.d.cL3nLXbE.js';
5
5
  import { SnapshotResult } from '@vitest/snapshot';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { MessagePort } from 'node:worker_threads';
2
- import { C as ContextRPC } from './worker.d.1GmBbd7G.js';
2
+ import { C as ContextRPC } from './worker.d.CUgIPz9V.js';
3
3
 
4
4
  interface WorkerContext extends ContextRPC {
5
5
  port: MessagePort;
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createCLI } from './chunks/cac.Cb-PYCCB.js';
1
+ import { c as createCLI } from './chunks/cac.0BJqEUeA.js';
2
2
  import '@vitest/utils';
3
3
  import 'events';
4
4
  import 'pathe';
package/dist/config.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.BFLkQcL6.js';
4
- export { f as TestProjectInlineConfiguration, g as WatcherTriggerPattern, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.BFLkQcL6.js';
5
- import './chunks/vite.d.CMLlLIFP.js';
6
- import { F as FakeTimerInstallOpts } from './chunks/config.d.D2ROskhv.js';
3
+ import { c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport, b as TestProjectConfiguration } from './chunks/reporters.d.BuRON0I0.js';
4
+ export { f as TestProjectInlineConfiguration, g as WatcherTriggerPattern, W as WorkspaceProjectConfiguration } from './chunks/reporters.d.BuRON0I0.js';
5
+ import './chunks/vite.d.BnOPPc46.js';
6
+ import { F as FakeTimerInstallOpts } from './chunks/config.d.BKdhh7Zx.js';
7
7
  import '@vitest/runner';
8
8
  import './chunks/environment.d.cL3nLXbE.js';
9
9
  import 'vitest/optional-types.js';
@@ -12,7 +12,7 @@ import 'node:stream';
12
12
  import 'node:console';
13
13
  import '@vitest/mocker';
14
14
  import '@vitest/utils/source-map';
15
- import './chunks/worker.d.1GmBbd7G.js';
15
+ import './chunks/worker.d.CUgIPz9V.js';
16
16
  import 'vite-node';
17
17
  import '@vitest/snapshot';
18
18
  import '@vitest/pretty-format';
@@ -1,4 +1,4 @@
1
- import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.BFLkQcL6.js';
1
+ import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.d.BuRON0I0.js';
2
2
  import { TransformResult } from 'vite';
3
3
  import { A as AfterSuiteRunMeta } from './chunks/environment.d.cL3nLXbE.js';
4
4
  import '@vitest/runner';
@@ -7,9 +7,9 @@ import 'node:stream';
7
7
  import 'node:console';
8
8
  import '@vitest/mocker';
9
9
  import '@vitest/utils/source-map';
10
- import './chunks/worker.d.1GmBbd7G.js';
10
+ import './chunks/worker.d.CUgIPz9V.js';
11
11
  import 'vite-node';
12
- import './chunks/config.d.D2ROskhv.js';
12
+ import './chunks/config.d.BKdhh7Zx.js';
13
13
  import '@vitest/pretty-format';
14
14
  import '@vitest/snapshot';
15
15
  import '@vitest/snapshot/environment';
package/dist/coverage.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BaseCoverageProvider } from './chunks/coverage.DL5VHqXY.js';
1
+ export { B as BaseCoverageProvider } from './chunks/coverage.DfSpMS-b.js';
2
2
  import 'node:fs';
3
3
  import 'pathe';
4
4
  import 'picomatch';
package/dist/execute.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { ViteNodeRunnerOptions } from 'vite-node';
2
2
  import { ViteNodeRunner, ModuleExecutionInfo } from 'vite-node/client';
3
- import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.d.1GmBbd7G.js';
3
+ import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.d.CUgIPz9V.js';
4
4
  import vm from 'node:vm';
5
5
  import { MockedModule, MockedModuleType } from '@vitest/mocker';
6
6
  import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
7
7
  import '@vitest/runner';
8
- import './chunks/config.d.D2ROskhv.js';
8
+ import './chunks/config.d.BKdhh7Zx.js';
9
9
  import '@vitest/pretty-format';
10
10
  import '@vitest/snapshot';
11
11
  import '@vitest/snapshot/environment';
package/dist/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { File as File$1, TestAnnotation, TaskResultPack as TaskResultPack$1, TaskEventPack, TaskPopulated, Suite as Suite$1, Test as Test$1, Custom as Custom$1, Task as Task$1, TaskBase as TaskBase$1, TaskResult as TaskResult$1, DoneCallback as DoneCallback$1, RuntimeContext as RuntimeContext$1, SuiteHooks as SuiteHooks$1, SequenceHooks as SequenceHooks$1, SequenceSetupFiles as SequenceSetupFiles$1 } from '@vitest/runner';
2
2
  export { CancelReason, ExtendedContext, HookCleanupCallback, HookListener, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Custom as RunnerCustomCase, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskContext, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
3
- import { S as SerializedTestSpecification, h as CoverageProvider$1, a as ReportContext$1, i as CoverageProviderModule$1, j as CoverageReporter$1, k as CoverageProviderName, l as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, m as CoverageIstanbulOptions$1, c as CoverageV8Options$1, n as CustomProviderOptions$1, o as Reporter$1, V as Vitest$1, p as BrowserScript$1, q as BrowserConfigOptions$1, r as BuiltinEnvironment$1, s as VitestEnvironment$1, P as Pool$1, t as PoolOptions$1, u as CSSModuleScopeStrategy$1, A as ApiConfig$1, v as VitestRunMode$1, D as DepsOptimizationOptions$1, w as TransformModePatterns$1, I as InlineConfig$1, x as TypecheckConfig$1, y as UserConfig$1, z as ResolvedConfig$1, E as ProjectConfig$1, U as UserWorkspaceConfig$1, F as BenchmarkUserOptions$1 } from './chunks/reporters.d.BFLkQcL6.js';
4
- export { G as BrowserTesterOptions } from './chunks/reporters.d.BFLkQcL6.js';
5
- import { W as WorkerContext$1 } from './chunks/worker.d.CKwWzBSj.js';
3
+ import { S as SerializedTestSpecification, h as CoverageProvider$1, a as ReportContext$1, i as CoverageProviderModule$1, j as CoverageReporter$1, k as CoverageProviderName, l as CoverageOptions$1, R as ResolvedCoverageOptions$1, B as BaseCoverageOptions$1, m as CoverageIstanbulOptions$1, c as CoverageV8Options$1, n as CustomProviderOptions$1, o as Reporter$1, V as Vitest$1, p as BrowserScript$1, q as BrowserConfigOptions$1, r as BuiltinEnvironment$1, s as VitestEnvironment$1, P as Pool$1, t as PoolOptions$1, u as CSSModuleScopeStrategy$1, A as ApiConfig$1, v as VitestRunMode$1, D as DepsOptimizationOptions$1, w as TransformModePatterns$1, I as InlineConfig$1, x as TypecheckConfig$1, y as UserConfig$1, z as ResolvedConfig$1, E as ProjectConfig$1, U as UserWorkspaceConfig$1, F as BenchmarkUserOptions$1 } from './chunks/reporters.d.BuRON0I0.js';
4
+ export { G as BrowserTesterOptions } from './chunks/reporters.d.BuRON0I0.js';
5
+ import { W as WorkerContext$1 } from './chunks/worker.d.uzWsCv9X.js';
6
6
  import { R as RawErrsMap$1, T as TscErrorInfo$1, C as CollectLineNumbers$1, a as CollectLines$1, b as RootAndTarget$1, c as Context$1 } from './chunks/global.d.MAmajcmJ.js';
7
7
  import { b as Awaitable$1, U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext, N as Nullable$1, c as Arrayable$1, d as ArgumentsType$1, e as MutableArray$1, C as Constructable$1, a as EnvironmentReturn$1, V as VmEnvironmentReturn$1, E as Environment$1, R as ResolvedTestEnvironment$1, J as JSDOMOptions$1, H as HappyDOMOptions$1, f as EnvironmentOptions$1 } from './chunks/environment.d.cL3nLXbE.js';
8
8
  export { A as AfterSuiteRunMeta, g as ModuleCache } from './chunks/environment.d.cL3nLXbE.js';
9
- import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.d.1GmBbd7G.js';
10
- export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.1GmBbd7G.js';
11
- import './chunks/vite.d.CMLlLIFP.js';
12
- import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.D2ROskhv.js';
13
- export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.D2ROskhv.js';
9
+ import { a as BirpcReturn, b as WorkerRPC$1 } from './chunks/worker.d.CUgIPz9V.js';
10
+ export { C as ContextRPC, d as ContextTestEnvironment, e as ResolveIdFunction, c as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.CUgIPz9V.js';
11
+ import './chunks/vite.d.BnOPPc46.js';
12
+ import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.BKdhh7Zx.js';
13
+ export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.BKdhh7Zx.js';
14
14
  import { ExpectStatic } from '@vitest/expect';
15
15
  export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, Matchers } from '@vitest/expect';
16
16
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
package/dist/node.d.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { z as ResolvedConfig, y as UserConfig, v as VitestRunMode, H as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, J as TestSequencer, K as TestSpecification, L as Logger, M as TestModule, N as ModuleDiagnostic } from './chunks/reporters.d.BFLkQcL6.js';
2
- export { B as BaseCoverageOptions, F as BenchmarkUserOptions, ag as BrowserBuiltinProvider, ah as BrowserCommand, ai as BrowserCommandContext, q as BrowserConfigOptions, aj as BrowserInstanceOption, ak as BrowserModuleMocker, al as BrowserOrchestrator, am as BrowserProvider, an as BrowserProviderInitializationOptions, ao as BrowserProviderModule, ap as BrowserProviderOptions, p as BrowserScript, aq as BrowserServerState, ar as BrowserServerStateSession, r as BuiltinEnvironment, as as CDPSession, u as CSSModuleScopeStrategy, m as CoverageIstanbulOptions, l as CoverageOptions, h as CoverageProvider, i as CoverageProviderModule, j as CoverageReporter, c as CoverageV8Options, n as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, O as OnServerRestartHandler, Q as OnTestsRerunHandler, at as ParentProjectBrowser, P as Pool, t as PoolOptions, Y as ProcessPool, au as ProjectBrowser, E as ProjectConfig, a as ReportContext, aA as ReportedHookContext, o as Reporter, ax as ResolveSnapshotPathHandler, ay as ResolveSnapshotPathHandlerContext, av as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aw as ResolvedProjectConfig, $ as SerializedTestProject, a3 as TaskOptions, a4 as TestCase, a5 as TestCollection, a6 as TestDiagnostic, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, aB as TestRunEndReason, az as TestRunResult, af as TestSequencerConstructor, ac as TestState, ad as TestSuite, ae as TestSuiteState, w as TransformModePatterns, x as TypecheckConfig, U as UserWorkspaceConfig, s as VitestEnvironment, X as VitestPackageInstaller, g as WatcherTriggerPattern, Z as WorkspaceSpec, _ as getFilePoolName } from './chunks/reporters.d.BFLkQcL6.js';
1
+ import { z as ResolvedConfig, y as UserConfig, v as VitestRunMode, H as VitestOptions, V as Vitest, A as ApiConfig, L as Logger, T as TestProject, J as TestSequencer, K as TestSpecification, M as TestModule, N as ModuleDiagnostic } from './chunks/reporters.d.BuRON0I0.js';
2
+ export { B as BaseCoverageOptions, F as BenchmarkUserOptions, ag as BrowserBuiltinProvider, ah as BrowserCommand, ai as BrowserCommandContext, q as BrowserConfigOptions, aj as BrowserInstanceOption, ak as BrowserModuleMocker, al as BrowserOrchestrator, am as BrowserProvider, an as BrowserProviderInitializationOptions, ao as BrowserProviderModule, ap as BrowserProviderOptions, p as BrowserScript, aq as BrowserServerState, ar as BrowserServerStateSession, r as BuiltinEnvironment, as as CDPSession, u as CSSModuleScopeStrategy, m as CoverageIstanbulOptions, l as CoverageOptions, h as CoverageProvider, i as CoverageProviderModule, j as CoverageReporter, c as CoverageV8Options, n as CustomProviderOptions, D as DepsOptimizationOptions, a0 as HTMLOptions, I as InlineConfig, a2 as JUnitOptions, a1 as JsonOptions, O as OnServerRestartHandler, Q as OnTestsRerunHandler, at as ParentProjectBrowser, P as Pool, t as PoolOptions, Y as ProcessPool, au as ProjectBrowser, E as ProjectConfig, a as ReportContext, aA as ReportedHookContext, o as Reporter, ax as ResolveSnapshotPathHandler, ay as ResolveSnapshotPathHandlerContext, av as ResolvedBrowserOptions, R as ResolvedCoverageOptions, aw as ResolvedProjectConfig, $ as SerializedTestProject, a3 as TaskOptions, a4 as TestCase, a5 as TestCollection, a6 as TestDiagnostic, a7 as TestModuleState, a8 as TestResult, a9 as TestResultFailed, aa as TestResultPassed, ab as TestResultSkipped, aB as TestRunEndReason, az as TestRunResult, af as TestSequencerConstructor, ac as TestState, ad as TestSuite, ae as TestSuiteState, w as TransformModePatterns, x as TypecheckConfig, U as UserWorkspaceConfig, s as VitestEnvironment, X as VitestPackageInstaller, g as WatcherTriggerPattern, Z as WorkspaceSpec, _ as getFilePoolName } from './chunks/reporters.d.BuRON0I0.js';
3
3
  import * as vite from 'vite';
4
4
  import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1 } from 'vite';
5
5
  export { vite as Vite };
6
6
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
7
7
  import { IncomingMessage } from 'node:http';
8
- import { R as RuntimeRPC } from './chunks/worker.d.1GmBbd7G.js';
9
- export { T as TestExecutionType } from './chunks/worker.d.1GmBbd7G.js';
8
+ import { R as RuntimeRPC } from './chunks/worker.d.CUgIPz9V.js';
9
+ export { T as TestExecutionType } from './chunks/worker.d.CUgIPz9V.js';
10
10
  import { Writable } from 'node:stream';
11
- export { V as VitestPluginContext } from './chunks/vite.d.CMLlLIFP.js';
12
- export { W as WorkerContext } from './chunks/worker.d.CKwWzBSj.js';
11
+ export { V as VitestPluginContext } from './chunks/vite.d.BnOPPc46.js';
12
+ export { W as WorkerContext } from './chunks/worker.d.uzWsCv9X.js';
13
13
  export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.d.MAmajcmJ.js';
14
14
  import { Debugger } from 'debug';
15
15
  export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
16
16
  export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d.cL3nLXbE.js';
17
17
  export { SerializedError } from '@vitest/utils';
18
- export { b as RuntimeConfig } from './chunks/config.d.D2ROskhv.js';
18
+ export { b as RuntimeConfig } from './chunks/config.d.BKdhh7Zx.js';
19
19
  export { generateFileHash } from '@vitest/runner/utils';
20
20
  import 'node:console';
21
21
  import '@vitest/mocker';
@@ -80,7 +80,7 @@ declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
80
80
  options: CliOptions
81
81
  };
82
82
 
83
- declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number): ApiConfig | undefined;
83
+ declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number, parentApi?: ApiConfig, logger?: Logger): ApiConfig | undefined;
84
84
 
85
85
  declare function createVitest(mode: VitestRunMode, options: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
86
86
 
package/dist/node.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as vite from 'vite';
2
2
  import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
3
3
  export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
4
- import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.BkDphVBG.js';
5
- export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.BkDphVBG.js';
6
- export { p as parseCLI } from './chunks/cac.Cb-PYCCB.js';
7
- import { r as resolveConfig$2 } from './chunks/coverage.DL5VHqXY.js';
8
- export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.DL5VHqXY.js';
4
+ import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.DWGBtMmz.js';
5
+ export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.DWGBtMmz.js';
6
+ export { p as parseCLI } from './chunks/cac.0BJqEUeA.js';
7
+ import { r as resolveConfig$2 } from './chunks/coverage.DfSpMS-b.js';
8
+ export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.DfSpMS-b.js';
9
9
  import { slash, deepClone } from '@vitest/utils';
10
10
  import { f as findUp } from './chunks/index.X0nbfr6-.js';
11
11
  import { resolve } from 'pathe';
@@ -1,4 +1,4 @@
1
- export { aQ as BaseReporter, aC as BasicReporter, aR as BenchmarkBuiltinReporters, aD as BenchmarkReporter, aE as BenchmarkReportsMap, aS as BuiltinReporterOptions, aT as BuiltinReporters, aF as DefaultReporter, aG as DotReporter, aH as GithubActionsReporter, aI as HangingProcessReporter, aK as JUnitReporter, aU as JsonAssertionResult, aJ as JsonReporter, aV as JsonTestResult, aW as JsonTestResults, aA as ReportedHookContext, o as Reporter, aL as ReportersMap, aM as TapFlatReporter, aN as TapReporter, aB as TestRunEndReason, aO as VerboseBenchmarkReporter, aP as VerboseReporter } from './chunks/reporters.d.BFLkQcL6.js';
1
+ export { aQ as BaseReporter, aC as BasicReporter, aR as BenchmarkBuiltinReporters, aD as BenchmarkReporter, aE as BenchmarkReportsMap, aS as BuiltinReporterOptions, aT as BuiltinReporters, aF as DefaultReporter, aG as DotReporter, aH as GithubActionsReporter, aI as HangingProcessReporter, aK as JUnitReporter, aU as JsonAssertionResult, aJ as JsonReporter, aV as JsonTestResult, aW as JsonTestResults, aA as ReportedHookContext, o as Reporter, aL as ReportersMap, aM as TapFlatReporter, aN as TapReporter, aB as TestRunEndReason, aO as VerboseBenchmarkReporter, aP as VerboseReporter } from './chunks/reporters.d.BuRON0I0.js';
2
2
  import '@vitest/runner';
3
3
  import './chunks/environment.d.cL3nLXbE.js';
4
4
  import 'vitest/optional-types.js';
@@ -8,9 +8,9 @@ import 'vite';
8
8
  import 'node:console';
9
9
  import '@vitest/mocker';
10
10
  import '@vitest/utils/source-map';
11
- import './chunks/worker.d.1GmBbd7G.js';
11
+ import './chunks/worker.d.CUgIPz9V.js';
12
12
  import 'vite-node';
13
- import './chunks/config.d.D2ROskhv.js';
13
+ import './chunks/config.d.BKdhh7Zx.js';
14
14
  import '@vitest/pretty-format';
15
15
  import '@vitest/snapshot';
16
16
  import '@vitest/snapshot/environment';
package/dist/runners.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as tinybench from 'tinybench';
2
2
  import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, Test, TestContext, ImportDuration } from '@vitest/runner';
3
3
  export { VitestRunner } from '@vitest/runner';
4
- import { a as SerializedConfig } from './chunks/config.d.D2ROskhv.js';
4
+ import { a as SerializedConfig } from './chunks/config.d.BKdhh7Zx.js';
5
5
  import '@vitest/pretty-format';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/snapshot/environment';
package/dist/workers.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.1GmBbd7G.js';
1
+ import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.CUgIPz9V.js';
2
2
  import { Awaitable } from '@vitest/utils';
3
3
  import * as v8 from 'v8';
4
- import { a as SerializedConfig } from './chunks/config.d.D2ROskhv.js';
5
- import { W as WorkerContext } from './chunks/worker.d.CKwWzBSj.js';
4
+ import { a as SerializedConfig } from './chunks/config.d.BKdhh7Zx.js';
5
+ import { W as WorkerContext } from './chunks/worker.d.uzWsCv9X.js';
6
6
  import '@vitest/runner';
7
7
  import 'vite-node';
8
8
  import './chunks/environment.d.cL3nLXbE.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "3.2.4",
4
+ "version": "3.2.6",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -119,8 +119,8 @@
119
119
  "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
120
120
  "happy-dom": "*",
121
121
  "jsdom": "*",
122
- "@vitest/browser": "3.2.4",
123
- "@vitest/ui": "3.2.4"
122
+ "@vitest/browser": "3.2.6",
123
+ "@vitest/ui": "3.2.6"
124
124
  },
125
125
  "peerDependenciesMeta": {
126
126
  "@edge-runtime/vm": {
@@ -160,15 +160,15 @@
160
160
  "tinypool": "^1.1.1",
161
161
  "tinyrainbow": "^2.0.0",
162
162
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
163
- "why-is-node-running": "^2.3.0",
164
- "@vitest/expect": "3.2.4",
165
- "@vitest/mocker": "3.2.4",
166
- "@vitest/snapshot": "3.2.4",
167
- "@vitest/runner": "3.2.4",
168
- "@vitest/pretty-format": "^3.2.4",
169
- "@vitest/spy": "3.2.4",
170
163
  "vite-node": "3.2.4",
171
- "@vitest/utils": "3.2.4"
164
+ "why-is-node-running": "^2.3.0",
165
+ "@vitest/expect": "3.2.6",
166
+ "@vitest/pretty-format": "^3.2.6",
167
+ "@vitest/mocker": "3.2.6",
168
+ "@vitest/runner": "3.2.6",
169
+ "@vitest/snapshot": "3.2.6",
170
+ "@vitest/spy": "3.2.6",
171
+ "@vitest/utils": "3.2.6"
172
172
  },
173
173
  "devDependencies": {
174
174
  "@ampproject/remapping": "^2.3.0",