vitest 3.0.8 → 3.0.9

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 (60) hide show
  1. package/dist/browser.d.ts +12 -23
  2. package/dist/browser.js +2 -2
  3. package/dist/chunks/{base.XvKTsMeK.js → base.DV59CbtV.js} +1 -1
  4. package/dist/chunks/{benchmark.Cdu9hjj4.js → benchmark.DL72EVN-.js} +1 -1
  5. package/dist/chunks/{benchmark.CFFwLv-O.d.ts → benchmark.d.BwvBVTda.d.ts} +11 -11
  6. package/dist/chunks/{cac.VN5q-TPC.js → cac.CeVHgzve.js} +5 -5
  7. package/dist/chunks/{cli-api.Dis64jtY.js → cli-api.Ckwz_xSb.js} +13 -8
  8. package/dist/chunks/config.d.DevWltVl.d.ts +218 -0
  9. package/dist/chunks/{constants.fzPh7AOq.js → constants.DTYd6dNH.js} +1 -1
  10. package/dist/chunks/{coverage.DnNIv-kJ.js → coverage.A3sS5-Wm.js} +1 -29
  11. package/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
  12. package/dist/chunks/{resolveConfig.L1_HR0_0.js → coverage.gV8doR2Y.js} +496 -127
  13. package/dist/chunks/{creator.2CFRE1Yx.js → creator.BsBnpTzI.js} +1 -1
  14. package/dist/chunks/defaults.C2Ndd9wx.js +119 -0
  15. package/dist/chunks/env.D4Lgay0q.js +8 -0
  16. package/dist/chunks/environment.d.C8UItCbf.d.ts +170 -0
  17. package/dist/chunks/global.d.Cg2sEPIm.d.ts +127 -0
  18. package/dist/chunks/{globals.CydvVTgC.js → globals.BEpDe-k3.js} +4 -4
  19. package/dist/chunks/{index.B7vJpkTD.js → index.B8tIoLPT.js} +6 -1
  20. package/dist/chunks/{index.CNRemkXW.js → index.D7Ny8f_s.js} +2 -2
  21. package/dist/chunks/{index.BmFgJtkv.js → index.uXkkC4xl.js} +1 -2
  22. package/dist/chunks/{mocker.cRtM890J.d.ts → mocker.d.BE_2ls6u.d.ts} +6 -6
  23. package/dist/chunks/reporters.d.CqBhtcTq.d.ts +3006 -0
  24. package/dist/chunks/{runBaseTests.DnaAUBKD.js → runBaseTests.BVrL_ow3.js} +8 -8
  25. package/dist/chunks/{setup-common.Uaw6Zgv9.js → setup-common.CPvtqi8q.js} +25 -2
  26. package/dist/chunks/{suite.qtkXWc6R.d.ts → suite.d.FvehnV49.d.ts} +1 -1
  27. package/dist/chunks/{typechecker.cZ0LjdSi.js → typechecker.BlF3eHsb.js} +2 -7
  28. package/dist/chunks/{vi.B5EKKJdE.js → vi.nSCvwQ7l.js} +3 -3
  29. package/dist/chunks/vite.d.BUZTGxQ3.d.ts +11 -0
  30. package/dist/chunks/{worker.BmVno_ab.d.ts → worker.d.C58isfFm.d.ts} +62 -62
  31. package/dist/chunks/{worker.BT4v-DKx.d.ts → worker.d.CSFlSYJg.d.ts} +2 -2
  32. package/dist/cli.js +2 -2
  33. package/dist/config.d.ts +48 -45
  34. package/dist/config.js +6 -123
  35. package/dist/coverage.d.ts +82 -79
  36. package/dist/coverage.js +19 -469
  37. package/dist/environments.d.ts +11 -11
  38. package/dist/execute.d.ts +109 -109
  39. package/dist/index.d.ts +414 -412
  40. package/dist/index.js +3 -3
  41. package/dist/node.d.ts +51 -48
  42. package/dist/node.js +13 -10
  43. package/dist/reporters.d.ts +7 -4
  44. package/dist/reporters.js +3 -2
  45. package/dist/runners.d.ts +28 -28
  46. package/dist/runners.js +2 -3
  47. package/dist/snapshot.d.ts +2 -2
  48. package/dist/suite.d.ts +2 -2
  49. package/dist/suite.js +1 -1
  50. package/dist/workers/forks.js +1 -1
  51. package/dist/workers/runVmTests.js +8 -8
  52. package/dist/workers/threads.js +1 -1
  53. package/dist/workers.d.ts +13 -13
  54. package/dist/workers.js +1 -1
  55. package/package.json +11 -11
  56. package/dist/chunks/config.BCv-fVdT.d.ts +0 -215
  57. package/dist/chunks/environment.d8YfPkTm.d.ts +0 -173
  58. package/dist/chunks/global.CnI8_G5V.d.ts +0 -133
  59. package/dist/chunks/reporters.66aFHiyX.d.ts +0 -3051
  60. package/dist/chunks/vite.BCQa3xFG.d.ts +0 -11
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.B5EKKJdE.js';
1
+ export { c as createExpect, a as expect, i as inject, v as vi, b as vitest } from './chunks/vi.nSCvwQ7l.js';
2
2
  export { i as isFirstRun, a as runOnce } from './chunks/run-once.2ogXb3JV.js';
3
- export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.CNRemkXW.js';
4
- export { b as bench } from './chunks/benchmark.Cdu9hjj4.js';
3
+ export { a as assertType, g as getRunningMode, i as isWatchMode } from './chunks/index.D7Ny8f_s.js';
4
+ export { b as bench } from './chunks/benchmark.DL72EVN-.js';
5
5
  export { expectTypeOf } from 'expect-type';
6
6
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
7
7
  import * as chai from 'chai';
package/dist/node.d.ts CHANGED
@@ -1,29 +1,32 @@
1
- import { x as ResolvedConfig, w as UserConfig, t as VitestRunMode, E as VitestOptions, V as Vitest, A as ApiConfig, F as TestProject, G as TestSequencer, H as TestSpecification, L as Logger, J as TestModule, M as ModuleDiagnostic } from './chunks/reporters.66aFHiyX.js';
2
- export { B as BaseCoverageOptions, z as BenchmarkUserOptions, ae as BrowserBuiltinProvider, af as BrowserCommand, ag as BrowserCommandContext, o as BrowserConfigOptions, ah as BrowserInstanceOption, ai as BrowserOrchestrator, aj as BrowserProvider, ak as BrowserProviderInitializationOptions, al as BrowserProviderModule, am as BrowserProviderOptions, n as BrowserScript, an as BrowserServerState, ao as BrowserServerStateSession, p as BuiltinEnvironment, ap as CDPSession, s as CSSModuleScopeStrategy, k as CoverageIstanbulOptions, j as CoverageOptions, c as CoverageProvider, g as CoverageProviderModule, h as CoverageReporter, d as CoverageV8Options, l as CustomProviderOptions, D as DepsOptimizationOptions, _ as HTMLOptions, I as InlineConfig, a0 as JUnitOptions, $ as JsonOptions, O as OnServerRestartHandler, K as OnTestsRerunHandler, aq as ParentProjectBrowser, P as Pool, r as PoolOptions, Q as ProcessPool, ar as ProjectBrowser, y as ProjectConfig, a as ReportContext, ax as ReportedHookContext, m as Reporter, au as ResolveSnapshotPathHandler, av as ResolveSnapshotPathHandlerContext, as as ResolvedBrowserOptions, R as ResolvedCoverageOptions, at as ResolvedProjectConfig, Z as SerializedTestProject, a1 as TaskOptions, a2 as TestCase, a3 as TestCollection, a4 as TestDiagnostic, a5 as TestModuleState, a6 as TestResult, a7 as TestResultFailed, a8 as TestResultPassed, a9 as TestResultSkipped, ay as TestRunEndReason, aw as TestRunResult, ad as TestSequencerConstructor, aa as TestState, ab as TestSuite, ac as TestSuiteState, u as TransformModePatterns, v as TypecheckConfig, U as UserWorkspaceConfig, q as VitestEnvironment, N as VitestPackageInstaller, X as WorkspaceSpec, Y as getFilePoolName } from './chunks/reporters.66aFHiyX.js';
1
+ import { w as ResolvedConfig, v as UserConfig, s as VitestRunMode, z as VitestOptions, V as Vitest, A as ApiConfig, E as TestProject, F as TestSequencer, G as TestSpecification, L as Logger, H as TestModule, M as ModuleDiagnostic } from './chunks/reporters.d.CqBhtcTq.js';
2
+ export { B as BaseCoverageOptions, y as BenchmarkUserOptions, ad as BrowserBuiltinProvider, ae as BrowserCommand, af as BrowserCommandContext, n as BrowserConfigOptions, ag as BrowserInstanceOption, ah as BrowserOrchestrator, ai as BrowserProvider, aj as BrowserProviderInitializationOptions, ak as BrowserProviderModule, al as BrowserProviderOptions, m as BrowserScript, am as BrowserServerState, an as BrowserServerStateSession, o as BuiltinEnvironment, ao as CDPSession, r as CSSModuleScopeStrategy, j as CoverageIstanbulOptions, i as CoverageOptions, e as CoverageProvider, f as CoverageProviderModule, g as CoverageReporter, b as CoverageV8Options, k as CustomProviderOptions, D as DepsOptimizationOptions, Z as HTMLOptions, I as InlineConfig, $ as JUnitOptions, _ as JsonOptions, O as OnServerRestartHandler, J as OnTestsRerunHandler, ap as ParentProjectBrowser, P as Pool, q as PoolOptions, N as ProcessPool, aq as ProjectBrowser, x as ProjectConfig, a as ReportContext, aw as ReportedHookContext, l as Reporter, at as ResolveSnapshotPathHandler, au as ResolveSnapshotPathHandlerContext, ar as ResolvedBrowserOptions, R as ResolvedCoverageOptions, as as ResolvedProjectConfig, Y as SerializedTestProject, a0 as TaskOptions, a1 as TestCase, a2 as TestCollection, a3 as TestDiagnostic, a4 as TestModuleState, a5 as TestResult, a6 as TestResultFailed, a7 as TestResultPassed, a8 as TestResultSkipped, ax as TestRunEndReason, av as TestRunResult, ac as TestSequencerConstructor, a9 as TestState, aa as TestSuite, ab as TestSuiteState, t as TransformModePatterns, u as TypecheckConfig, U as UserWorkspaceConfig, p as VitestEnvironment, K as VitestPackageInstaller, Q as WorkspaceSpec, X as getFilePoolName } from './chunks/reporters.d.CqBhtcTq.js';
3
3
  import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1, LogLevel, LoggerOptions, Logger as Logger$1, createServer as createServer$1 } from 'vite';
4
4
  import * as vite from 'vite';
5
5
  export { vite as Vite };
6
6
  export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
7
7
  import { IncomingMessage } from 'node:http';
8
- import { R as RuntimeRPC } from './chunks/worker.BmVno_ab.js';
8
+ import { R as RuntimeRPC } from './chunks/worker.d.C58isfFm.js';
9
9
  import { Writable } from 'node:stream';
10
- export { W as WorkerContext } from './chunks/worker.BT4v-DKx.js';
11
- export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.CnI8_G5V.js';
10
+ export { W as WorkerContext } from './chunks/worker.d.CSFlSYJg.js';
11
+ export { C as TypeCheckCollectLineNumbers, a as TypeCheckCollectLines, c as TypeCheckContext, T as TypeCheckErrorInfo, R as TypeCheckRawErrorsMap, b as TypeCheckRootAndTarget } from './chunks/global.d.Cg2sEPIm.js';
12
12
  import { Debugger } from 'debug';
13
13
  export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
14
- export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d8YfPkTm.js';
14
+ export { f as EnvironmentOptions, H as HappyDOMOptions, J as JSDOMOptions } from './chunks/environment.d.C8UItCbf.js';
15
15
  export { SerializedError } from '@vitest/utils';
16
- export { b as RuntimeConfig } from './chunks/config.BCv-fVdT.js';
17
- import './chunks/vite.BCQa3xFG.js';
16
+ export { b as RuntimeConfig } from './chunks/config.d.DevWltVl.js';
17
+ import './chunks/vite.d.BUZTGxQ3.js';
18
18
  export { generateFileHash } from '@vitest/runner/utils';
19
+ import 'node:console';
19
20
  import '@vitest/utils/source-map';
20
21
  import '@vitest/pretty-format';
21
22
  import '@vitest/snapshot';
22
23
  import '@vitest/utils/diff';
23
24
  import 'vite-node';
24
25
  import 'chai';
25
- import './chunks/benchmark.CFFwLv-O.js';
26
+ import './chunks/benchmark.d.BwvBVTda.js';
26
27
  import 'tinybench';
28
+ import './chunks/coverage.d.S9RMNXIe.js';
29
+ import 'vite-node/client';
27
30
  import '@vitest/snapshot/manager';
28
31
  import 'node:fs';
29
32
  import 'node:worker_threads';
@@ -33,36 +36,36 @@ import '@vitest/snapshot/environment';
33
36
  declare function isValidApiRequest(config: ResolvedConfig, req: IncomingMessage): boolean;
34
37
 
35
38
  interface CliOptions extends UserConfig {
36
- /**
37
- * Override the watch mode
38
- */
39
- run?: boolean;
40
- /**
41
- * Removes colors from the console output
42
- */
43
- color?: boolean;
44
- /**
45
- * Output collected tests as JSON or to a file
46
- */
47
- json?: string | boolean;
48
- /**
49
- * Output collected test files only
50
- */
51
- filesOnly?: boolean;
39
+ /**
40
+ * Override the watch mode
41
+ */
42
+ run?: boolean;
43
+ /**
44
+ * Removes colors from the console output
45
+ */
46
+ color?: boolean;
47
+ /**
48
+ * Output collected tests as JSON or to a file
49
+ */
50
+ json?: string | boolean;
51
+ /**
52
+ * Output collected test files only
53
+ */
54
+ filesOnly?: boolean;
52
55
  }
53
56
  /**
54
- * Start Vitest programmatically
55
- *
56
- * Returns a Vitest instance if initialized successfully.
57
- */
57
+ * Start Vitest programmatically
58
+ *
59
+ * Returns a Vitest instance if initialized successfully.
60
+ */
58
61
  declare function startVitest(mode: VitestRunMode, cliFilters?: string[], options?: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
59
62
 
60
63
  interface CliParseOptions {
61
- allowUnknownOptions?: boolean;
64
+ allowUnknownOptions?: boolean;
62
65
  }
63
66
  declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
64
- filter: string[];
65
- options: CliOptions;
67
+ filter: string[]
68
+ options: CliOptions
66
69
  };
67
70
 
68
71
  declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number): ApiConfig | undefined;
@@ -70,12 +73,12 @@ declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(
70
73
  declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
71
74
 
72
75
  declare class FilesNotFoundError extends Error {
73
- code: string;
74
- constructor(mode: 'test' | 'benchmark');
76
+ code: string;
77
+ constructor(mode: "test" | "benchmark");
75
78
  }
76
79
  declare class GitNotFoundError extends Error {
77
- code: string;
78
- constructor();
80
+ code: string;
81
+ constructor();
79
82
  }
80
83
 
81
84
  /** @deprecated use `TestProject` instead */
@@ -84,23 +87,23 @@ type GlobalSetupContext = TestProject;
84
87
  declare function VitestPlugin(options?: UserConfig, ctx?: Vitest): Promise<Plugin[]>;
85
88
 
86
89
  declare function resolveConfig(options?: UserConfig, viteOverrides?: UserConfig$1): Promise<{
87
- vitestConfig: ResolvedConfig;
88
- viteConfig: ResolvedConfig$1;
90
+ vitestConfig: ResolvedConfig
91
+ viteConfig: ResolvedConfig$1
89
92
  }>;
90
93
 
91
94
  declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | false | undefined): string[];
92
95
 
93
96
  interface MethodsOptions {
94
- cacheFs?: boolean;
95
- collect?: boolean;
97
+ cacheFs?: boolean;
98
+ collect?: boolean;
96
99
  }
97
100
  declare function createMethodsRPC(project: TestProject, options?: MethodsOptions): RuntimeRPC;
98
101
 
99
102
  declare class BaseSequencer implements TestSequencer {
100
- protected ctx: Vitest;
101
- constructor(ctx: Vitest);
102
- shard(files: TestSpecification[]): Promise<TestSpecification[]>;
103
- sort(files: TestSpecification[]): Promise<TestSpecification[]>;
103
+ protected ctx: Vitest;
104
+ constructor(ctx: Vitest);
105
+ shard(files: TestSpecification[]): Promise<TestSpecification[]>;
106
+ sort(files: TestSpecification[]): Promise<TestSpecification[]>;
104
107
  }
105
108
 
106
109
  declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream | undefined, stdout: NodeJS.WriteStream | Writable): () => void;
@@ -119,13 +122,13 @@ declare const createServer: typeof createServer$1;
119
122
  declare const createViteServer: typeof createServer$1;
120
123
 
121
124
  /**
122
- * @deprecated Use `TestModule` instead
123
- */
125
+ * @deprecated Use `TestModule` instead
126
+ */
124
127
  declare const TestFile: typeof TestModule;
125
128
 
126
129
  /**
127
- * @deprecated Use `ModuleDiagnostic` instead
128
- */
130
+ * @deprecated Use `ModuleDiagnostic` instead
131
+ */
129
132
  type FileDiagnostic = ModuleDiagnostic;
130
133
 
131
134
  export { ApiConfig, BaseSequencer, type CliParseOptions, type FileDiagnostic, GitNotFoundError, type GlobalSetupContext, ModuleDiagnostic, ResolvedConfig, TestFile, TestModule, TestProject, TestSequencer, TestSpecification, FilesNotFoundError as TestsNotFoundError, UserConfig, Vitest, VitestOptions, VitestPlugin, VitestRunMode, TestProject as WorkspaceProject, createDebugger, createMethodsRPC, createServer, createViteLogger, createViteServer, createVitest, distDir, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest, version };
package/dist/node.js CHANGED
@@ -1,32 +1,33 @@
1
1
  import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
2
2
  export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
3
- import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.Dis64jtY.js';
4
- 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.Dis64jtY.js';
5
- export { p as parseCLI } from './chunks/cac.VN5q-TPC.js';
6
- import { a as resolveConfig$2 } from './chunks/resolveConfig.L1_HR0_0.js';
7
- export { B as BaseSequencer, d as createMethodsRPC, g as getFilePoolName, b as resolveApiServerConfig } from './chunks/resolveConfig.L1_HR0_0.js';
3
+ import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.Ckwz_xSb.js';
4
+ 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.Ckwz_xSb.js';
5
+ export { p as parseCLI } from './chunks/cac.CeVHgzve.js';
6
+ import { r as resolveConfig$2 } from './chunks/coverage.gV8doR2Y.js';
7
+ export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.gV8doR2Y.js';
8
8
  import { slash } from '@vitest/utils';
9
9
  import { f as findUp } from './chunks/index.DBIGubLC.js';
10
10
  import { resolve } from 'pathe';
11
- import { c as configFiles } from './chunks/constants.fzPh7AOq.js';
11
+ import { c as configFiles } from './chunks/constants.DTYd6dNH.js';
12
12
  export { distDir, rootDir } from './path.js';
13
13
  import createDebug from 'debug';
14
14
  export { generateFileHash } from '@vitest/runner/utils';
15
15
  import 'node:fs';
16
- import './chunks/coverage.DnNIv-kJ.js';
16
+ import './chunks/coverage.A3sS5-Wm.js';
17
17
  import 'node:path';
18
18
  import '@vitest/snapshot/manager';
19
19
  import 'vite-node/client';
20
20
  import 'vite-node/server';
21
21
  import './chunks/index.68735LiX.js';
22
- import './chunks/index.B7vJpkTD.js';
22
+ import './chunks/index.B8tIoLPT.js';
23
23
  import 'tinyrainbow';
24
24
  import './chunks/utils.bLM2atbD.js';
25
25
  import 'node:util';
26
26
  import 'node:perf_hooks';
27
27
  import '@vitest/utils/source-map';
28
- import './chunks/typechecker.cZ0LjdSi.js';
28
+ import './chunks/env.D4Lgay0q.js';
29
29
  import 'std-env';
30
+ import './chunks/typechecker.BlF3eHsb.js';
30
31
  import 'node:fs/promises';
31
32
  import 'tinyexec';
32
33
  import 'node:os';
@@ -50,14 +51,15 @@ import 'node:crypto';
50
51
  import 'path';
51
52
  import 'vite-node/utils';
52
53
  import '@vitest/mocker/node';
54
+ import './chunks/defaults.C2Ndd9wx.js';
53
55
  import 'magic-string';
54
56
  import 'node:assert';
55
57
  import '@vitest/utils/error';
56
58
  import 'node:readline';
59
+ import 'util';
57
60
  import 'node:process';
58
61
  import 'node:v8';
59
62
  import 'node:tty';
60
- import 'util';
61
63
  import 'node:events';
62
64
  import 'tinypool';
63
65
  import 'node:worker_threads';
@@ -88,6 +90,7 @@ async function resolveConfig(options = {}, viteOverrides = {}) {
88
90
  updatedOptions,
89
91
  config
90
92
  );
93
+ await vitest.close();
91
94
  return {
92
95
  viteConfig: config,
93
96
  vitestConfig
@@ -1,19 +1,22 @@
1
- export { aN as BaseReporter, az as BasicReporter, aO as BenchmarkBuiltinReporters, aA as BenchmarkReporter, aB as BenchmarkReportsMap, aP as BuiltinReporterOptions, aQ as BuiltinReporters, aC as DefaultReporter, aD as DotReporter, aE as GithubActionsReporter, aF as HangingProcessReporter, aH as JUnitReporter, aR as JsonAssertionResult, aG as JsonReporter, aS as JsonTestResult, aT as JsonTestResults, ax as ReportedHookContext, m as Reporter, aI as ReportersMap, aJ as TapFlatReporter, aK as TapReporter, ay as TestRunEndReason, aL as VerboseBenchmarkReporter, aM as VerboseReporter } from './chunks/reporters.66aFHiyX.js';
1
+ export { aM as BaseReporter, ay as BasicReporter, aN as BenchmarkBuiltinReporters, az as BenchmarkReporter, aA as BenchmarkReportsMap, aO as BuiltinReporterOptions, aP as BuiltinReporters, aB as DefaultReporter, aC as DotReporter, aD as GithubActionsReporter, aE as HangingProcessReporter, aG as JUnitReporter, aQ as JsonAssertionResult, aF as JsonReporter, aR as JsonTestResult, aS as JsonTestResults, aw as ReportedHookContext, l as Reporter, aH as ReportersMap, aI as TapFlatReporter, aJ as TapReporter, ax as TestRunEndReason, aK as VerboseBenchmarkReporter, aL as VerboseReporter } from './chunks/reporters.d.CqBhtcTq.js';
2
2
  import '@vitest/runner';
3
- import './chunks/environment.d8YfPkTm.js';
3
+ import './chunks/environment.d.C8UItCbf.js';
4
4
  import '@vitest/utils';
5
5
  import 'node:stream';
6
6
  import 'vite';
7
+ import 'node:console';
7
8
  import '@vitest/utils/source-map';
8
- import './chunks/config.BCv-fVdT.js';
9
+ import './chunks/config.d.DevWltVl.js';
9
10
  import '@vitest/pretty-format';
10
11
  import '@vitest/snapshot';
11
12
  import '@vitest/snapshot/environment';
12
13
  import '@vitest/utils/diff';
13
14
  import 'vite-node';
14
15
  import 'chai';
15
- import './chunks/benchmark.CFFwLv-O.js';
16
+ import './chunks/benchmark.d.BwvBVTda.js';
16
17
  import '@vitest/runner/utils';
17
18
  import 'tinybench';
19
+ import './chunks/coverage.d.S9RMNXIe.js';
20
+ import 'vite-node/client';
18
21
  import '@vitest/snapshot/manager';
19
22
  import 'node:fs';
package/dist/reporters.js CHANGED
@@ -1,4 +1,4 @@
1
- export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.B7vJpkTD.js';
1
+ export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.B8tIoLPT.js';
2
2
  import 'node:fs';
3
3
  import '@vitest/runner/utils';
4
4
  import 'pathe';
@@ -8,8 +8,9 @@ import 'node:util';
8
8
  import '@vitest/utils';
9
9
  import 'node:perf_hooks';
10
10
  import '@vitest/utils/source-map';
11
- import './chunks/typechecker.cZ0LjdSi.js';
11
+ import './chunks/env.D4Lgay0q.js';
12
12
  import 'std-env';
13
+ import './chunks/typechecker.BlF3eHsb.js';
13
14
  import 'node:fs/promises';
14
15
  import 'tinyexec';
15
16
  import 'vite';
package/dist/runners.d.ts CHANGED
@@ -1,43 +1,43 @@
1
1
  import * as tinybench from 'tinybench';
2
2
  import { VitestRunner, VitestRunnerImportSource, Suite, File, Task, CancelReason, TestContext } from '@vitest/runner';
3
3
  export { VitestRunner } from '@vitest/runner';
4
- import { a as SerializedConfig } from './chunks/config.BCv-fVdT.js';
4
+ import { a as SerializedConfig } from './chunks/config.d.DevWltVl.js';
5
5
  import '@vitest/pretty-format';
6
6
  import '@vitest/snapshot';
7
7
  import '@vitest/snapshot/environment';
8
8
  import '@vitest/utils/diff';
9
9
 
10
10
  declare class NodeBenchmarkRunner implements VitestRunner {
11
- config: SerializedConfig;
12
- private __vitest_executor;
13
- constructor(config: SerializedConfig);
14
- importTinybench(): Promise<typeof tinybench>;
15
- importFile(filepath: string, source: VitestRunnerImportSource): unknown;
16
- runSuite(suite: Suite): Promise<void>;
17
- runTask(): Promise<void>;
11
+ config: SerializedConfig;
12
+ private __vitest_executor;
13
+ constructor(config: SerializedConfig);
14
+ importTinybench(): Promise<typeof tinybench>;
15
+ importFile(filepath: string, source: VitestRunnerImportSource): unknown;
16
+ runSuite(suite: Suite): Promise<void>;
17
+ runTask(): Promise<void>;
18
18
  }
19
19
 
20
20
  declare class VitestTestRunner implements VitestRunner {
21
- config: SerializedConfig;
22
- private snapshotClient;
23
- private workerState;
24
- private __vitest_executor;
25
- private cancelRun;
26
- private assertionsErrors;
27
- pool: string;
28
- constructor(config: SerializedConfig);
29
- importFile(filepath: string, source: VitestRunnerImportSource): unknown;
30
- onCollectStart(file: File): void;
31
- onAfterRunFiles(): void;
32
- onAfterRunSuite(suite: Suite): Promise<void>;
33
- onAfterRunTask(test: Task): void;
34
- onCancel(_reason: CancelReason): void;
35
- injectValue(key: string): any;
36
- onBeforeRunTask(test: Task): Promise<void>;
37
- onBeforeRunSuite(suite: Suite): Promise<void>;
38
- onBeforeTryTask(test: Task): void;
39
- onAfterTryTask(test: Task): void;
40
- extendTaskContext(context: TestContext): TestContext;
21
+ config: SerializedConfig;
22
+ private snapshotClient;
23
+ private workerState;
24
+ private __vitest_executor;
25
+ private cancelRun;
26
+ private assertionsErrors;
27
+ pool: string;
28
+ constructor(config: SerializedConfig);
29
+ importFile(filepath: string, source: VitestRunnerImportSource): unknown;
30
+ onCollectStart(file: File): void;
31
+ onAfterRunFiles(): void;
32
+ onAfterRunSuite(suite: Suite): Promise<void>;
33
+ onAfterRunTask(test: Task): void;
34
+ onCancel(_reason: CancelReason): void;
35
+ injectValue(key: string): any;
36
+ onBeforeRunTask(test: Task): Promise<void>;
37
+ onBeforeRunSuite(suite: Suite): Promise<void>;
38
+ onBeforeTryTask(test: Task): void;
39
+ onAfterTryTask(test: Task): void;
40
+ extendTaskContext(context: TestContext): TestContext;
41
41
  }
42
42
 
43
43
  export { NodeBenchmarkRunner, VitestTestRunner };
package/dist/runners.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { updateTask } from '@vitest/runner';
2
2
  import { createDefer, getSafeTimers } from '@vitest/utils';
3
- import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.Cdu9hjj4.js';
3
+ import { a as getBenchOptions, g as getBenchFn } from './chunks/benchmark.DL72EVN-.js';
4
4
  import { g as getWorkerState } from './chunks/utils.C8RiOc4B.js';
5
5
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
6
6
  import { getTests, getNames, getTestName } from '@vitest/runner/utils';
7
- import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.B5EKKJdE.js';
7
+ import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.nSCvwQ7l.js';
8
8
  import { r as rpc } from './chunks/rpc.TVf73xOu.js';
9
9
  import 'chai';
10
10
  import './chunks/_commonjsHelpers.BFTU3MAI.js';
@@ -224,7 +224,6 @@ class VitestTestRunner {
224
224
  isExpectingAssertionsError: null,
225
225
  expectedAssertionsNumber: null,
226
226
  expectedAssertionsNumberErrorGen: null,
227
- testPath: test.file.filepath,
228
227
  currentTestName: getTestName(test),
229
228
  snapshotState: this.snapshotClient.getSnapshotState(test.file.filepath)
230
229
  },
@@ -2,8 +2,8 @@ import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
2
2
  export { SnapshotEnvironment } from '@vitest/snapshot/environment';
3
3
 
4
4
  declare class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
5
- getHeader(): string;
6
- resolvePath(filepath: string): Promise<string>;
5
+ getHeader(): string;
6
+ resolvePath(filepath: string): Promise<string>;
7
7
  }
8
8
 
9
9
  export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment };
package/dist/suite.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.qtkXWc6R.js';
1
+ export { g as getBenchFn, a as getBenchOptions } from './chunks/suite.d.FvehnV49.js';
2
2
  export { VitestRunner, VitestRunnerConfig, createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
3
3
  export { createChainable } from '@vitest/runner/utils';
4
- import './chunks/benchmark.CFFwLv-O.js';
4
+ import './chunks/benchmark.d.BwvBVTda.js';
5
5
  import 'tinybench';
package/dist/suite.js CHANGED
@@ -1,4 +1,4 @@
1
- export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.Cdu9hjj4.js';
1
+ export { g as getBenchFn, a as getBenchOptions } from './chunks/benchmark.DL72EVN-.js';
2
2
  export { createTaskCollector, getCurrentSuite, getCurrentTest, getFn, getHooks, setFn, setHooks } from '@vitest/runner';
3
3
  export { createChainable } from '@vitest/runner/utils';
4
4
  import '@vitest/utils';
@@ -1,5 +1,5 @@
1
1
  import v8 from 'node:v8';
2
- import { r as runBaseTests } from '../chunks/base.XvKTsMeK.js';
2
+ import { r as runBaseTests } from '../chunks/base.DV59CbtV.js';
3
3
  import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.Cn0zI1t3.js';
4
4
  import 'vite-node/client';
5
5
  import '../chunks/execute.eDH0aFFd.js';
@@ -6,11 +6,10 @@ import util from 'node:util';
6
6
  import { startTests, collectTests } from '@vitest/runner';
7
7
  import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
8
8
  import { installSourcemapsSupport } from 'vite-node/source-map';
9
- import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.BmFgJtkv.js';
10
- import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/coverage.DnNIv-kJ.js';
11
- import { V as VitestIndex } from '../chunks/index.CNRemkXW.js';
9
+ import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.uXkkC4xl.js';
10
+ import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.CPvtqi8q.js';
11
+ import { V as VitestIndex } from '../chunks/index.D7Ny8f_s.js';
12
12
  import { c as closeInspector } from '../chunks/inspector.DKLceBVD.js';
13
- import { s as setupCommonEnv } from '../chunks/setup-common.Uaw6Zgv9.js';
14
13
  import { g as getWorkerState } from '../chunks/utils.C8RiOc4B.js';
15
14
  import 'chai';
16
15
  import 'node:path';
@@ -19,17 +18,18 @@ import 'node:url';
19
18
  import '../chunks/rpc.TVf73xOu.js';
20
19
  import '@vitest/utils';
21
20
  import '../chunks/index.68735LiX.js';
22
- import '../chunks/vi.B5EKKJdE.js';
21
+ import '../chunks/coverage.A3sS5-Wm.js';
22
+ import '@vitest/snapshot';
23
+ import '../chunks/run-once.2ogXb3JV.js';
24
+ import '../chunks/vi.nSCvwQ7l.js';
23
25
  import '@vitest/expect';
24
26
  import '@vitest/runner/utils';
25
27
  import '../chunks/_commonjsHelpers.BFTU3MAI.js';
26
- import '@vitest/snapshot';
27
28
  import '@vitest/utils/error';
28
29
  import '@vitest/spy';
29
30
  import '@vitest/utils/source-map';
30
31
  import '../chunks/date.W2xKR2qe.js';
31
- import '../chunks/run-once.2ogXb3JV.js';
32
- import '../chunks/benchmark.Cdu9hjj4.js';
32
+ import '../chunks/benchmark.DL72EVN-.js';
33
33
  import 'expect-type';
34
34
 
35
35
  async function run(method, files, config, executor) {
@@ -1,4 +1,4 @@
1
- import { r as runBaseTests } from '../chunks/base.XvKTsMeK.js';
1
+ import { r as runBaseTests } from '../chunks/base.DV59CbtV.js';
2
2
  import { a as createThreadsRpcOptions } from '../chunks/utils.Cn0zI1t3.js';
3
3
  import 'vite-node/client';
4
4
  import '../chunks/execute.eDH0aFFd.js';
package/dist/workers.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.BmVno_ab.js';
1
+ import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.C58isfFm.js';
2
2
  import { Awaitable } from '@vitest/utils';
3
3
  import * as v8 from 'v8';
4
- import { a as SerializedConfig } from './chunks/config.BCv-fVdT.js';
5
- import { W as WorkerContext } from './chunks/worker.BT4v-DKx.js';
4
+ import { a as SerializedConfig } from './chunks/config.d.DevWltVl.js';
5
+ import { W as WorkerContext } from './chunks/worker.d.CSFlSYJg.js';
6
6
  import '@vitest/runner';
7
7
  import 'vite-node';
8
- import './chunks/environment.d8YfPkTm.js';
8
+ import './chunks/environment.d.C8UItCbf.js';
9
9
  import '@vitest/snapshot';
10
10
  import '@vitest/pretty-format';
11
11
  import '@vitest/snapshot/environment';
@@ -17,22 +17,22 @@ declare function provideWorkerState(context: any, state: WorkerGlobalState): Wor
17
17
  declare function run(ctx: ContextRPC): Promise<void>;
18
18
  declare function collect(ctx: ContextRPC): Promise<void>;
19
19
 
20
- declare function runBaseTests(method: 'run' | 'collect', state: WorkerGlobalState): Promise<void>;
20
+ declare function runBaseTests(method: "run" | "collect", state: WorkerGlobalState): Promise<void>;
21
21
 
22
- type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, 'on' | 'post' | 'serialize' | 'deserialize'>;
22
+ type WorkerRpcOptions = Pick<BirpcOptions<RuntimeRPC>, "on" | "post" | "serialize" | "deserialize">;
23
23
  interface VitestWorker {
24
- getRpcOptions: (ctx: ContextRPC) => WorkerRpcOptions;
25
- runTests: (state: WorkerGlobalState) => Awaitable<unknown>;
26
- collectTests: (state: WorkerGlobalState) => Awaitable<unknown>;
24
+ getRpcOptions: (ctx: ContextRPC) => WorkerRpcOptions;
25
+ runTests: (state: WorkerGlobalState) => Awaitable<unknown>;
26
+ collectTests: (state: WorkerGlobalState) => Awaitable<unknown>;
27
27
  }
28
28
 
29
- declare function createThreadsRpcOptions({ port, }: WorkerContext): WorkerRpcOptions;
29
+ declare function createThreadsRpcOptions({ port }: WorkerContext): WorkerRpcOptions;
30
30
  declare function createForksRpcOptions(nodeV8: typeof v8): WorkerRpcOptions;
31
31
  /**
32
- * Reverts the wrapping done by `utils/config-helpers.ts`'s `wrapSerializableConfig`
33
- */
32
+ * Reverts the wrapping done by `utils/config-helpers.ts`'s `wrapSerializableConfig`
33
+ */
34
34
  declare function unwrapSerializableConfig(config: SerializedConfig): SerializedConfig;
35
35
 
36
- declare function runVmTests(method: 'run' | 'collect', state: WorkerGlobalState): Promise<void>;
36
+ declare function runVmTests(method: "run" | "collect", state: WorkerGlobalState): Promise<void>;
37
37
 
38
38
  export { type VitestWorker, type WorkerRpcOptions, collect as collectVitestWorkerTests, createForksRpcOptions, createThreadsRpcOptions, provideWorkerState, runBaseTests, run as runVitestWorker, runVmTests, unwrapSerializableConfig };
package/dist/workers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { p as provideWorkerState } from './chunks/utils.C8RiOc4B.js';
2
2
  export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
3
- export { r as runBaseTests } from './chunks/base.XvKTsMeK.js';
3
+ export { r as runBaseTests } from './chunks/base.DV59CbtV.js';
4
4
  export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.Cn0zI1t3.js';
5
5
  export { r as runVmTests } from './chunks/vm.jEFQDlX_.js';
6
6
  import '@vitest/utils';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "3.0.8",
4
+ "version": "3.0.9",
5
5
  "description": "Next generation testing framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -123,8 +123,8 @@
123
123
  "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
124
124
  "happy-dom": "*",
125
125
  "jsdom": "*",
126
- "@vitest/ui": "3.0.8",
127
- "@vitest/browser": "3.0.8"
126
+ "@vitest/browser": "3.0.9",
127
+ "@vitest/ui": "3.0.9"
128
128
  },
129
129
  "peerDependenciesMeta": {
130
130
  "@edge-runtime/vm": {
@@ -162,14 +162,14 @@
162
162
  "tinyrainbow": "^2.0.0",
163
163
  "vite": "^5.0.0 || ^6.0.0",
164
164
  "why-is-node-running": "^2.3.0",
165
- "@vitest/expect": "3.0.8",
166
- "@vitest/mocker": "3.0.8",
167
- "@vitest/pretty-format": "^3.0.8",
168
- "@vitest/runner": "3.0.8",
169
- "@vitest/spy": "3.0.8",
170
- "vite-node": "3.0.8",
171
- "@vitest/utils": "3.0.8",
172
- "@vitest/snapshot": "3.0.8"
165
+ "@vitest/mocker": "3.0.9",
166
+ "@vitest/expect": "3.0.9",
167
+ "@vitest/pretty-format": "^3.0.9",
168
+ "@vitest/runner": "3.0.9",
169
+ "@vitest/snapshot": "3.0.9",
170
+ "@vitest/utils": "3.0.9",
171
+ "@vitest/spy": "3.0.9",
172
+ "vite-node": "3.0.9"
173
173
  },
174
174
  "devDependencies": {
175
175
  "@ampproject/remapping": "^2.3.0",