vitest 5.0.5 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/browser.d.ts +6 -5
  3. package/dist/browser.js +6 -6
  4. package/dist/chunks/{base.CzXt2BO_.js → base.Cof-UHJf.js} +17 -21
  5. package/dist/chunks/{browser.d.FGQ9_rK6.d.ts → browser.d.C7tWgUvw.d.ts} +4 -3
  6. package/dist/chunks/{cac.CLrZKo1g.js → cac.BYbt0aJp.js} +30 -16
  7. package/dist/chunks/{cli-api.De07GUeT.js → cli-api.COfZo8lK.js} +5226 -4385
  8. package/dist/chunks/{config.d.QBNYCgFU.d.ts → config.d.B3YV4t0O.d.ts} +169 -93
  9. package/dist/chunks/{console.DtI4yxfN.js → console.CQZ877Hi.js} +6 -3
  10. package/dist/chunks/{constants.-juJ8b_4.js → constants.DLYM6cZY.js} +1 -1
  11. package/dist/chunks/{coverage.-bm5IxnW.js → coverage.9iqXE2gN.js} +1 -1
  12. package/dist/chunks/{coverage.cTDc4uSS.js → coverage.jGCktcGP.js} +1 -1
  13. package/dist/chunks/{creator.C5g4egeG.js → creator.DHWmytIK.js} +11 -11
  14. package/dist/chunks/{doctor.BK86Cncq.js → doctor.B-oPbwps.js} +2 -2
  15. package/dist/chunks/{environment.d.BY56MoGs.d.ts → environment.d.BFQtFKdZ.d.ts} +1 -1
  16. package/dist/chunks/{globals.CXEE6_2C.js → globals.ZKtKSkEf.js} +7 -6
  17. package/dist/chunks/{index.CK-t0WMg.js → index.Bi0NXYPf.js} +165 -62
  18. package/dist/chunks/{index.aTZaPVhf.js → index.CZzC1gGg.js} +299 -440
  19. package/dist/chunks/{index.1TqnEahn.js → index.Di8au7q4.js} +104 -72
  20. package/dist/chunks/{index.CoUIxZd4.js → index.w_oBZ9N8.js} +5 -5
  21. package/dist/chunks/{init-forks.CRxIPOJR.js → init-forks.BaDXQSD8.js} +1 -1
  22. package/dist/chunks/{init-threads.Dv3kwST_.js → init-threads.ZX_Vov0z.js} +1 -1
  23. package/dist/chunks/{init.PvxYpuCm.js → init.CO4AB7HZ.js} +4 -4
  24. package/dist/chunks/{module-dependencies.CwNPkcV4.js → module-dependencies._2Eei3FO.js} +1 -1
  25. package/dist/chunks/{native.cdzHIdmv.js → native.upB-V0CK.js} +1 -1
  26. package/dist/chunks/{nativeModuleMocker.BxrHJNAF.js → nativeModuleMocker.Dh5azSB4.js} +4 -3
  27. package/dist/chunks/{nativeModuleRunner.xi64Afb2.js → nativeModuleRunner.9xPIMzi7.js} +1 -1
  28. package/dist/chunks/{node.uQulW0ei.js → node.B9mkVmLH.js} +1 -1
  29. package/dist/chunks/{pathe.M-eThtNZ.Ba-7h1rE.js → pathe.M-eThtNZ.zq3TM4NT.js} +1 -1
  30. package/dist/chunks/{plugin.d.C8mmycim.d.ts → plugin.d.LRFSN46m.d.ts} +191 -32
  31. package/dist/chunks/rawSnapshot.DqSiqIEx.js +356 -0
  32. package/dist/chunks/{resolver.CtCcxIy1.js → resolver.BzpmeQeT.js} +1 -1
  33. package/dist/chunks/{rpc.DpkUyY1N.js → rpc.Uhkwr2NM.js} +2 -2
  34. package/dist/chunks/{rpc.d.Cft1biqy.d.ts → rpc.d.3FOhdFx8.d.ts} +1 -1
  35. package/dist/chunks/{run.BPv-BBRv.js → run.CjdgFZiW.js} +28 -7
  36. package/dist/chunks/{setup-common.HGAqWOnX.js → setup-common.CqAQCXzx.js} +2 -2
  37. package/dist/chunks/{source-map.DdKI5IHB.js → source-map.DakdQc29.js} +43 -37
  38. package/dist/chunks/{source-map.d.kzFtk_dj.d.ts → source-map.d.BkG8YK_3.d.ts} +2 -1
  39. package/dist/chunks/{task-utils.d.PFh2BV6Q.d.ts → task-utils.d.D-gFPNFi.d.ts} +2 -1
  40. package/dist/chunks/{utils.DSfl_w8V.js → utils.BBk_icFG.js} +6 -3
  41. package/dist/chunks/{vm.FGl2rw_t.js → vm.b4MbCAJQ.js} +27 -14
  42. package/dist/chunks/{worker.d.BH-r1bPu.d.ts → worker.d.CyJRpyfZ.d.ts} +3 -3
  43. package/dist/cli.js +3 -3
  44. package/dist/config.cjs +1 -1
  45. package/dist/config.d.ts +11 -11
  46. package/dist/config.js +1 -1
  47. package/dist/index.d.ts +21 -15
  48. package/dist/index.js +6 -5
  49. package/dist/module-evaluator.d.ts +3 -2
  50. package/dist/node.d.ts +30 -12
  51. package/dist/node.js +16 -14
  52. package/dist/runtime.d.ts +4 -4
  53. package/dist/runtime.js +5 -4
  54. package/dist/task-utils.js +10 -4
  55. package/dist/worker.d.ts +4 -4
  56. package/dist/worker.js +14 -13
  57. package/dist/workers/forks.js +15 -14
  58. package/dist/workers/runVmTests.js +16 -12
  59. package/dist/workers/threads.js +15 -14
  60. package/dist/workers/vmForks.js +11 -10
  61. package/dist/workers/vmThreads.js +11 -10
  62. package/package.json +17 -17
@@ -1,6 +1,6 @@
1
1
  import { stripVTControlCharacters } from 'node:util';
2
2
  import { t as truncateString$1 } from './display.BlTmubjj.js';
3
- import { i as isAbsolute, a as relative, d as dirname, b as basename, s as slash } from './pathe.M-eThtNZ.Ba-7h1rE.js';
3
+ import { i as isAbsolute, a as relative, d as dirname, b as basename, s as slash } from './pathe.M-eThtNZ.zq3TM4NT.js';
4
4
  import { $ } from './tinyrainbow.Do8I1XRG.js';
5
5
 
6
6
  const F_RIGHT = "→";
@@ -149,7 +149,9 @@ function padSummaryTitle(str) {
149
149
  return $.dim(`${str.padStart(11)} `);
150
150
  }
151
151
  function truncateString(text, maxLength) {
152
- return truncateString$1(stripVTControlCharacters(text), maxLength);
152
+ const plainText = stripVTControlCharacters(text);
153
+ if (plainText.length <= maxLength) return text;
154
+ return truncateString$1(plainText, maxLength);
153
155
  }
154
156
  function capitalize(text) {
155
157
  return `${text[0].toUpperCase()}${text.slice(1)}`;
@@ -170,6 +172,7 @@ var utils = /*#__PURE__*/Object.freeze({
170
172
  formatProjectName: formatProjectName,
171
173
  formatTime: formatTime,
172
174
  formatTimeString: formatTimeString,
175
+ getCols: getCols,
173
176
  getStateString: getStateString,
174
177
  getStateSymbol: getStateSymbol,
175
178
  noun: noun,
@@ -181,4 +184,4 @@ var utils = /*#__PURE__*/Object.freeze({
181
184
  withLabel: withLabel
182
185
  });
183
186
 
184
- export { F_CHECK as F, F_POINTER as a, F_DOWN_RIGHT as b, formatProjectName as c, getStateString as d, formatTime as e, formatTimeString as f, getStateSymbol as g, countTestErrors as h, errorBanner as i, divider as j, F_TREE_NODE_END as k, F_TREE_NODE_MIDDLE as l, F_RIGHT as m, noun as n, truncateString as o, padSummaryTitle as p, renderSnapshotSummary as r, separator as s, taskFail as t, utils as u, withLabel as w };
187
+ export { F_TREE_NODE_MIDDLE as F, F_TREE_NODE_END as a, F_CHECK as b, F_POINTER as c, F_DOWN_RIGHT as d, formatProjectName as e, formatTimeString as f, getStateSymbol as g, getStateString as h, formatTime as i, countTestErrors as j, errorBanner as k, divider as l, F_RIGHT as m, noun as n, getCols as o, padSummaryTitle as p, truncateString as q, renderSnapshotSummary as r, separator as s, taskFail as t, utils as u, withLabel as w };
@@ -1,18 +1,18 @@
1
1
  import { fileURLToPath, pathToFileURL } from 'node:url';
2
2
  import v8 from 'node:v8';
3
3
  import vm, { isContext, runInContext } from 'node:vm';
4
- import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.PvxYpuCm.js';
4
+ import { l as loadEnvironment, a as listenForErrors, e as emitModuleRunner } from './init.CO4AB7HZ.js';
5
5
  import { distDir } from '../path.js';
6
- import { createCustomConsole } from './console.DtI4yxfN.js';
6
+ import { createCustomConsole } from './console.CQZ877Hi.js';
7
7
  import fs__default from 'node:fs';
8
8
  import { createRequire, Module, isBuiltin } from 'node:module';
9
- import { d as dirname, f as extname, b as basename, C as CSS_LANGS_RE, h as KNOWN_ASSET_RE, t as toArray, k as splitFileAndPostfix, n as normalize, l as isBareImport, r as resolve } from './pathe.M-eThtNZ.Ba-7h1rE.js';
10
- import { l as lookupPackageScopeType } from './resolver.CtCcxIy1.js';
9
+ import { d as dirname, k as extname, b as basename, C as CSS_LANGS_RE, l as KNOWN_ASSET_RE, t as toArray, m as splitFileAndPostfix, n as normalize, o as isBareImport, r as resolve } from './pathe.M-eThtNZ.zq3TM4NT.js';
10
+ import { l as lookupPackageScopeType } from './resolver.BzpmeQeT.js';
11
11
  import { initSync, parse } from 'es-module-lexer';
12
12
  import { dirname as dirname$1 } from 'node:path';
13
- import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, c as createNodeImportMeta } from './index.CK-t0WMg.js';
13
+ import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, c as createNodeImportMeta } from './index.Bi0NXYPf.js';
14
14
  import { getDefaultRequestStubs } from '../module-evaluator.js';
15
- import { b as setupEnv } from './setup-common.HGAqWOnX.js';
15
+ import { b as setupEnv } from './setup-common.CqAQCXzx.js';
16
16
  import { p as provideWorkerState } from './utils.DYj33du9.js';
17
17
 
18
18
  /**
@@ -344,7 +344,8 @@ class CommonjsExecutor {
344
344
  }
345
345
  requireJs = (m, filename) => {
346
346
  const content = this.fs.readFile(filename);
347
- m._compile(content, filename);
347
+ const code = content.startsWith("#!") ? `//${content.slice(2)}` : content;
348
+ m._compile(code, filename);
348
349
  };
349
350
  requireJson = (m, filename) => {
350
351
  const code = this.fs.readFile(filename);
@@ -457,6 +458,14 @@ class CommonjsExecutor {
457
458
  this.moduleCache.set(identifier, module);
458
459
  return module;
459
460
  }
461
+ syncBuiltinESMExports() {
462
+ Module.syncBuiltinESMExports();
463
+ for (const [identifier, module] of this.moduleCache) {
464
+ if (!isBuiltin(identifier) || module.status !== "evaluated") continue;
465
+ const exports = this.require(identifier);
466
+ for (const key of Object.keys(module.namespace)) if (key !== "default") module.setExport(key, exports[key]);
467
+ }
468
+ }
460
469
  getCjsSyntheticModule(path, identifier) {
461
470
  if (this.moduleCache.has(identifier)) return this.moduleCache.get(identifier);
462
471
  const exports = this.require(path);
@@ -984,6 +993,9 @@ class ExternalModulesExecutor {
984
993
  });
985
994
  this.resolvers = [this.vite.resolve];
986
995
  }
996
+ syncBuiltinESMExports() {
997
+ this.cjs.syncBuiltinESMExports();
998
+ }
987
999
  async import(identifier) {
988
1000
  const module = await this.createModule(identifier);
989
1001
  await this.esm.evaluateModule(module);
@@ -1232,20 +1244,21 @@ async function runVmTests(method, state, traces) {
1232
1244
  if (!vm.getVmContext) throw new TypeError(`Environment ${environment.name} doesn't provide "getVmContext" method. It should return a context created by "vm.createContext" method.`);
1233
1245
  const context = vm.getVmContext();
1234
1246
  if (!isContext(context)) throw new TypeError(`Environment ${environment.name} doesn't provide a valid context. It should be created by "vm.createContext" method.`);
1235
- // captured before vitest installs its own globals (worker state, console,
1236
- // mocker, executor symbol): they reference the test file's module graph, so
1237
- // the teardown strip must treat them as removable, not as pristine
1238
- const initialContextKeys = captureContextKeys(context);
1239
- provideWorkerState(context, state);
1240
1247
  // this is unfortunately needed for our own dependencies
1241
1248
  // we need to find a way to not rely on this by default
1242
1249
  // because browser doesn't provide these globals
1243
1250
  context.process = process;
1244
1251
  context.global = context;
1245
- context.console = state.config.disableConsoleIntercept ? console : createCustomConsole(state);
1246
1252
  // TODO: don't hardcode setImmediate in fake timers defaults
1247
1253
  context.setImmediate = setImmediate;
1248
1254
  context.clearImmediate = clearImmediate;
1255
+ // captured before vitest installs its own globals (worker state, console,
1256
+ // mocker, executor symbol): they reference the test file's module graph, so
1257
+ // the teardown strip must treat them as removable, not as pristine. The
1258
+ // globals above are kept, work a test file didn't await may still use them
1259
+ const initialContextKeys = captureContextKeys(context);
1260
+ provideWorkerState(context, state);
1261
+ context.console = state.config.disableConsoleIntercept ? console : createCustomConsole(state);
1249
1262
  const stubs = getDefaultRequestStubs(context);
1250
1263
  const externalModulesExecutor = new ExternalModulesExecutor({
1251
1264
  context,
@@ -1290,7 +1303,7 @@ async function runVmTests(method, state, traces) {
1290
1303
  await moduleRunner.mocker.initializeSpyModule();
1291
1304
  const { run } = await moduleRunner.import(entryFile);
1292
1305
  try {
1293
- await run(method, ctx.files, ctx.config, moduleRunner, traces);
1306
+ await run(method, ctx.files, ctx.config, moduleRunner, traces, () => externalModulesExecutor.syncBuiltinESMExports());
1294
1307
  } finally {
1295
1308
  await traces.$("vitest.runtime.environment.teardown", () => vm.teardown?.());
1296
1309
  // unregisters the runner from Vite's `Error.prepareStackTrace` interceptor:
@@ -1,7 +1,7 @@
1
1
  import { EvaluatedModules } from 'vite/module-runner';
2
- import { F as FileSpecification, b as SerializedConfig, X as Task, Y as CancelReason } from './config.d.QBNYCgFU.js';
3
- import { a as RuntimeRPC, R as RunnerRPC, G as GetterTracker } from './rpc.d.Cft1biqy.js';
4
- import { E as Environment } from './environment.d.BY56MoGs.js';
2
+ import { F as FileSpecification, b as SerializedConfig, Y as Task, Z as CancelReason } from './config.d.B3YV4t0O.js';
3
+ import { a as RuntimeRPC, R as RunnerRPC, G as GetterTracker } from './rpc.d.3FOhdFx8.js';
4
+ import { E as Environment } from './environment.d.BFQtFKdZ.js';
5
5
 
6
6
  //#region src/messages.d.ts
7
7
  declare const TYPE_REQUEST: "q";
package/dist/cli.js CHANGED
@@ -1,10 +1,10 @@
1
- import { c as createCLI } from './chunks/cac.CLrZKo1g.js';
2
- import './chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
1
+ import { c as createCLI } from './chunks/cac.BYbt0aJp.js';
2
+ import './chunks/pathe.M-eThtNZ.zq3TM4NT.js';
3
3
  import 'events';
4
4
  import './chunks/tinyrainbow.Do8I1XRG.js';
5
5
  import './chunks/env.BKKtU2WC.js';
6
6
  import 'std-env';
7
- import './chunks/constants.-juJ8b_4.js';
7
+ import './chunks/constants.DLYM6cZY.js';
8
8
  import 'node:assert';
9
9
 
10
10
  createCLI().parse();
package/dist/config.cjs CHANGED
@@ -10,7 +10,7 @@ const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.ve
10
10
  (isNode || isDeno) && process.stdout?.isTTY && !stdEnv.isCI;
11
11
 
12
12
  // if changed, update also jsdocs and docs
13
- const defaultBrowserPort = 63315;
13
+ const defaultBrowserPort = 23315;
14
14
 
15
15
  const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
16
16
  const defaultExclude = ["**/node_modules/**", "**/.git/**"];
package/dist/config.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import { HookHandler, UserConfig, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
3
- import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.C8mmycim.js';
3
+ import { F as FieldsWithDefaultValues, U as UserWorkspaceConfig, a as UserProjectConfigFn, b as UserProjectConfigExport } from './chunks/plugin.d.LRFSN46m.js';
4
4
  import { InlineConfig, ResolvedConfig, VitestPluginContext, CoverageOptions } from './node.js';
5
- export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.C8mmycim.js';
6
- import { C as Config } from './chunks/config.d.QBNYCgFU.js';
7
- export { e as TestTagDefinition } from './chunks/config.d.QBNYCgFU.js';
5
+ export { T as TestProjectConfiguration, c as TestProjectInlineConfiguration, d as TestUserConfig, W as WatcherTriggerPattern } from './chunks/plugin.d.LRFSN46m.js';
6
+ import { FakeTimersConfig } from './index.js';
7
+ export { g as TestTagDefinition } from './chunks/config.d.B3YV4t0O.js';
8
8
  import 'node:stream';
9
- import './chunks/browser.d.FGQ9_rK6.js';
10
- import './chunks/rpc.d.Cft1biqy.js';
9
+ import './chunks/browser.d.C7tWgUvw.js';
10
+ import './chunks/rpc.d.3FOhdFx8.js';
11
11
  import 'vite/module-runner';
12
- import './chunks/worker.d.BH-r1bPu.js';
13
- import './chunks/environment.d.BY56MoGs.js';
12
+ import './chunks/worker.d.CyJRpyfZ.js';
13
+ import './chunks/environment.d.BFQtFKdZ.js';
14
14
  import 'chai';
15
15
  import 'vitest/optional-types.js';
16
16
  import '@vitest/mocker';
17
- import './chunks/source-map.d.kzFtk_dj.js';
17
+ import './chunks/source-map.d.BkG8YK_3.js';
18
18
  import 'vitest/browser';
19
19
  import 'node:path';
20
20
  import 'node:console';
@@ -42,7 +42,7 @@ declare module "vite" {
42
42
  }
43
43
  }
44
44
 
45
- declare const defaultBrowserPort = 63315;
45
+ declare const defaultBrowserPort = 23315;
46
46
 
47
47
  declare const defaultInclude: string[];
48
48
  declare const defaultExclude: string[];
@@ -75,7 +75,7 @@ declare const configDefaults: Readonly<{
75
75
  include: never[];
76
76
  };
77
77
  coverage: CoverageOptions;
78
- fakeTimers: Config;
78
+ fakeTimers: FakeTimersConfig;
79
79
  maxConcurrency: number;
80
80
  dangerouslyIgnoreUnhandledErrors: boolean;
81
81
  typecheck: {
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { c as configDefaults, a as coverageConfigDefaults, d as defaultExclude, b as defaultInclude } from './chunks/defaults.B1FCaFfh.js';
2
2
  export { mergeConfig } from 'vite';
3
- export { d as defaultBrowserPort } from './chunks/constants.-juJ8b_4.js';
3
+ export { d as defaultBrowserPort } from './chunks/constants.DLYM6cZY.js';
4
4
  import 'node:os';
5
5
  import './chunks/env.BKKtU2WC.js';
6
6
  import 'std-env';
package/dist/index.d.ts CHANGED
@@ -1,21 +1,22 @@
1
- import { a as File, A as Awaitable, g as TestAnnotation, h as TestArtifact, j as TaskResultPack, k as TaskEventPack, U as UserConsoleLog, l as SerializedRootConfig, L as LabelColor, M as ModuleGraphData, m as Test, n as TaskPopulated, E as ExpectStatic, o as ProvidedContext, p as MatcherState, q as SyncExpectationResult, r as AsyncExpectationResult, t as DomainSnapshotAdapter, u as ExpectationResult, v as Procedure, w as Mock, C as Config, x as spyOn, y as fn, z as MaybeMockedDeep, B as MaybeMocked, G as MaybePartiallyMocked, H as MaybePartiallyMockedDeep, I as MockInstance, R as RuntimeOptions, J as TestAPI, K as SuiteCollector, N as SuiteAPI, O as Suite, Q as SuiteHooks, V as VitestRunner, b as SerializedConfig, W as VitestRunnerImportSource, X as Task, Y as CancelReason, Z as TestTryOptions, $ as TestContext, a0 as ImportDuration, a1 as createChainable } from './chunks/config.d.QBNYCgFU.js';
2
- export { a2 as AfterSuiteRunMeta, a3 as Assertion, a4 as AsymmetricMatchersContaining, a5 as BaselineData, a6 as Bench, a7 as BenchFn, a8 as BenchFnOptions, a9 as BenchFromSource, aa as BenchOptions, ab as BenchRegistration, ac as BenchRegistrationInput, ad as BenchResult, ae as BenchRunOptions, af as BenchStorage, ag as BenchmarkGroup, ah as BenchmarkProvider, ai as BrowserTraceArtifact, aj as DeeplyAllowMatchers, D as DiffOptions, ak as DomainMatchResult, al as FailureScreenshotArtifact, am as JestAssertion, an as Matcher, ao as Matchers, ap as MatchersObject, aq as MockContext, ar as MockResult, as as MockResultIncomplete, at as MockResultReturn, au as MockResultThrow, av as MockSettledResult, aw as MockSettledResultFulfilled, ax as MockSettledResultIncomplete, ay as MockSettledResultRejected, az as Mocked, aA as MockedClass, aB as MockedFunction, aC as MockedObject, aD as OnTestFailedHandler, aE as OnTestFinishedHandler, P as ParsedStack, aF as RunMode, aG as RunnerTaskBase, aH as RunnerTaskResult, aI as RuntimeConfig, S as SerializedCoverageConfig, aJ as SerializedError, aK as SnapshotData, aL as SnapshotMatchOptions, aM as SnapshotResult, aN as SnapshotSerializer, aO as SnapshotStateOptions, aP as SnapshotSummary, aQ as SnapshotUpdateState, aR as SuiteFactory, aS as SuiteOptions, aT as TaskCustomOptions, aU as TaskMeta, aV as TaskState, aW as TestAnnotationArtifact, aX as TestAnnotationLocation, aY as TestArtifactBase, aZ as TestArtifactLocation, a_ as TestArtifactRegistry, a$ as TestAttachment, b0 as TestBenchmark, b1 as TestBenchmarkTask, T as TestError, b2 as TestFunction, b3 as TestOptions, e as TestTagDefinition, b4 as TestTags, b5 as UncheckedSnapshot, b6 as VisualRegressionArtifact, b7 as afterAll, b8 as afterEach, b9 as aroundAll, ba as aroundEach, bb as beforeAll, bc as beforeEach, bd as onTestFailed, be as onTestFinished } from './chunks/config.d.QBNYCgFU.js';
3
- import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.FGQ9_rK6.js';
4
- export { B as BrowserTesterOptions } from './chunks/browser.d.FGQ9_rK6.js';
5
- import { c as createFileTask } from './chunks/task-utils.d.PFh2BV6Q.js';
6
- import { B as BirpcReturn } from './chunks/worker.d.BH-r1bPu.js';
7
- export { C as ContextRPC, a as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.BH-r1bPu.js';
1
+ /// <reference types="chai" />
2
+ import { a as File, A as Awaitable, h as TestAnnotation, j as TestArtifact, k as TaskResultPack, l as TaskEventPack, U as UserConsoleLog, m as SerializedRootConfig, L as LabelColor, M as ModuleGraphData, n as Test, o as TaskPopulated, E as ExpectStatic, p as ProvidedContext, q as MatcherState, r as SyncExpectationResult, t as AsyncExpectationResult, u as DomainSnapshotAdapter, v as ExpectationResult, w as Procedure, x as Mock, e as FakeTimersConfig, y as TemporalTimelike, z as spyOn, B as fn, C as MaybeMockedDeep, G as MaybeMocked, H as MaybePartiallyMocked, I as MaybePartiallyMockedDeep, J as MockInstance, R as RuntimeOptions, K as TestAPI, N as SuiteCollector, O as SuiteAPI, Q as Suite, W as SuiteHooks, V as VitestRunner, b as SerializedConfig, X as VitestRunnerImportSource, Y as Task, Z as CancelReason, $ as TestTryOptions, a0 as TestContext, a1 as ImportDuration, a2 as createChainable } from './chunks/config.d.B3YV4t0O.js';
3
+ export { a3 as AfterSuiteRunMeta, a4 as Assertion, a5 as AsymmetricMatchersContaining, a6 as BaselineData, a7 as Bench, a8 as BenchFn, a9 as BenchFnOptions, aa as BenchFromSource, ab as BenchOptions, ac as BenchRegistration, ad as BenchRegistrationInput, ae as BenchResult, af as BenchRunOptions, ag as BenchStorage, ah as BenchmarkGroup, ai as BenchmarkProvider, aj as BrowserTraceArtifact, ak as DeeplyAllowMatchers, D as DiffOptions, al as DomainMatchResult, am as FailureScreenshotArtifact, an as JestAssertion, ao as Matcher, ap as Matchers, aq as MatchersObject, ar as MockContext, as as MockResult, at as MockResultIncomplete, au as MockResultReturn, av as MockResultThrow, aw as MockSettledResult, ax as MockSettledResultFulfilled, ay as MockSettledResultIncomplete, az as MockSettledResultRejected, aA as Mocked, aB as MockedClass, aC as MockedFunction, aD as MockedObject, aE as OnTestFailedHandler, aF as OnTestFinishedHandler, P as ParsedStack, aG as RunMode, aH as RunnerTaskBase, aI as RunnerTaskResult, aJ as RunnerTaskResultAttempt, aK as RuntimeConfig, S as SerializedCoverageConfig, aL as SerializedError, aM as SnapshotData, aN as SnapshotMatchOptions, aO as SnapshotResult, aP as SnapshotSerializer, aQ as SnapshotStateOptions, aR as SnapshotSummary, aS as SnapshotUpdateState, aT as SuiteFactory, aU as SuiteOptions, aV as TaskCustomOptions, aW as TaskMeta, aX as TaskState, aY as TestAnnotationArtifact, aZ as TestAnnotationLocation, a_ as TestArtifactBase, a$ as TestArtifactLocation, b0 as TestArtifactRegistry, b1 as TestAttachment, b2 as TestBenchmark, b3 as TestBenchmarkTask, T as TestError, b4 as TestFunction, b5 as TestOptions, g as TestTagDefinition, b6 as TestTags, b7 as UncheckedSnapshot, b8 as VisualRegressionArtifact, b9 as afterAll, ba as afterEach, bb as aroundAll, bc as aroundEach, bd as beforeAll, be as beforeEach, bf as onTestFailed, bg as onTestFinished } from './chunks/config.d.B3YV4t0O.js';
4
+ import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.C7tWgUvw.js';
5
+ export { B as BrowserTesterOptions } from './chunks/browser.d.C7tWgUvw.js';
6
+ import { c as createFileTask } from './chunks/task-utils.d.D-gFPNFi.js';
7
+ import { B as BirpcReturn } from './chunks/worker.d.CyJRpyfZ.js';
8
+ export { C as ContextRPC, a as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.CyJRpyfZ.js';
8
9
  import { Disposable } from 'vitest/optional-runtime-types.js';
9
10
  import { ModuleMockFactoryWithHelper, ModuleMockOptions } from '@vitest/mocker';
10
11
  export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';
11
- import { T as Traces } from './chunks/rpc.d.Cft1biqy.js';
12
- export { R as RunnerRPC, a as RuntimeRPC } from './chunks/rpc.d.Cft1biqy.js';
12
+ import { T as Traces } from './chunks/rpc.d.3FOhdFx8.js';
13
+ export { R as RunnerRPC, a as RuntimeRPC } from './chunks/rpc.d.3FOhdFx8.js';
13
14
  export { ExpectTypeOf, expectTypeOf } from 'expect-type';
14
15
  export { BenchOptions as BenchCompareOptions } from 'tinybench';
15
16
  import * as chai from 'chai';
16
17
  export { chai };
17
18
  import 'vite/module-runner';
18
- import './chunks/environment.d.BY56MoGs.js';
19
+ import './chunks/environment.d.BFQtFKdZ.js';
19
20
 
20
21
  interface SourceMap {
21
22
  file: string;
@@ -413,10 +414,14 @@ interface WaitForOptions {
413
414
  * @default 1000ms
414
415
  */
415
416
  timeout?: number;
417
+ /**
418
+ * @description Message that describes what is being waited for. It prefixes the error and names the trace step
419
+ */
420
+ message?: string;
416
421
  }
417
422
  declare function waitFor<T>(callback: WaitForCallback<T>, options?: number | WaitForOptions): Promise<T>;
418
423
  type WaitUntilCallback<T> = () => T | Promise<T>;
419
- interface WaitUntilOptions extends Pick<WaitForOptions, "interval" | "timeout"> {}
424
+ interface WaitUntilOptions extends Pick<WaitForOptions, "interval" | "timeout" | "message"> {}
420
425
  type Truthy<T> = T extends false | "" | 0 | null | undefined ? never : T;
421
426
  declare function waitUntil<T>(callback: WaitUntilCallback<T>, options?: number | WaitUntilOptions): Promise<Truthy<T>>;
422
427
 
@@ -429,7 +434,7 @@ interface VitestUtils {
429
434
  /**
430
435
  * This method wraps all further calls to timers until [`vi.useRealTimers()`](https://vitest.dev/api/vi#vi-userealtimers) is called.
431
436
  */
432
- useFakeTimers: (config?: Config) => VitestUtils;
437
+ useFakeTimers: (config?: FakeTimersConfig) => VitestUtils;
433
438
  /**
434
439
  * Restores mocked timers to their original implementations. All timers that were scheduled before will be discarded.
435
440
  */
@@ -486,7 +491,7 @@ interface VitestUtils {
486
491
  * If fake timers are enabled, this method simulates a user changing the system clock (will affect date related API like `hrtime`, `performance.now` or `new Date()`) - however, it will not fire any timers.
487
492
  * If fake timers are not enabled, this method will only mock `Date.*` and `new Date()` calls.
488
493
  */
489
- setSystemTime: (time: number | string | Date) => VitestUtils;
494
+ setSystemTime: (time: number | string | Date | TemporalTimelike) => VitestUtils;
490
495
  /**
491
496
  * Returns mocked current date. If date is not mocked the method will return `null`.
492
497
  */
@@ -1029,7 +1034,8 @@ declare class TestRunner implements VitestRunner {
1029
1034
  injectValue(key: string): any;
1030
1035
  onBeforeRunTask(test: Task): Promise<void>;
1031
1036
  onBeforeRunSuite(suite: Suite): Promise<void>;
1032
- onBeforeTryTask(test: Task, _options: TestTryOptions): void;
1037
+ onBeforeTryTask(test: Task, options: TestTryOptions): void;
1038
+ onAfterRetryTask(test: Test, _options: TestTryOptions): Promise<void>;
1033
1039
  onAfterTryTask(test: Test): void;
1034
1040
  extendTaskContext(context: TestContext): TestContext;
1035
1041
  getImportDurations(): Record<string, ImportDuration>;
@@ -1065,5 +1071,5 @@ declare namespace Experimental {
1065
1071
  /** @deprecated use `SerializedConfig` instead */
1066
1072
  type TestRunnerConfig = SerializedConfig;
1067
1073
 
1068
- export { AsyncExpectationResult as AsyncMatcherResult, CancelReason, DomainSnapshotAdapter, ExpectStatic, Experimental, ImportDuration, LabelColor, ExpectationResult as MatcherResult, MatcherState, Mock, MockInstance, ModuleGraphData, ProvidedContext, Task as RunnerTask, TaskEventPack as RunnerTaskEventPack, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SerializedConfig, SerializedRootConfig, SerializedTestSpecification, Snapshots, SuiteAPI, SuiteCollector, SyncExpectationResult as SyncMatcherResult, TestAPI, TestAnnotation, TestArtifact, TestContext, TestRunner, TestTryOptions, UserConsoleLog, VitestRunner as VitestTestRunner, assert, assertType, createExpect, describe, globalExpect as expect, inject, it, recordArtifact, should, suite, test, vi, vitest };
1074
+ export { AsyncExpectationResult as AsyncMatcherResult, CancelReason, DomainSnapshotAdapter, ExpectStatic, Experimental, FakeTimersConfig, ImportDuration, LabelColor, ExpectationResult as MatcherResult, MatcherState, Mock, MockInstance, ModuleGraphData, ProvidedContext, Task as RunnerTask, TaskEventPack as RunnerTaskEventPack, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SerializedConfig, SerializedRootConfig, SerializedTestSpecification, Snapshots, SuiteAPI, SuiteCollector, SyncExpectationResult as SyncMatcherResult, TestAPI, TestAnnotation, TestArtifact, TestContext, TestRunner, TestTryOptions, UserConsoleLog, VitestRunner as VitestTestRunner, assert, assertType, createExpect, describe, globalExpect as expect, inject, it, recordArtifact, should, suite, test, vi, vitest };
1069
1075
  export type { AssertType, BrowserUI, ExternalResult, TestRunnerConfig, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };
package/dist/index.js CHANGED
@@ -1,18 +1,19 @@
1
- export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.aTZaPVhf.js';
2
- export { V as EvaluatedModules } from './chunks/rpc.DpkUyY1N.js';
3
- export { j as afterAll, k as afterEach, l as aroundAll, n as aroundEach, o as beforeAll, q as beforeEach, r as describe, t as it, u as onTestFailed, v as onTestFinished, w as recordArtifact, x as suite, y as test } from './chunks/run.BPv-BBRv.js';
1
+ export { S as Snapshots, T as TestRunner, a as assert, b as assertType, c as createExpect, g as expect, d as inject, s as should, v as vi, e as vitest } from './chunks/index.CZzC1gGg.js';
2
+ export { V as EvaluatedModules } from './chunks/rpc.Uhkwr2NM.js';
3
+ export { k as afterAll, l as afterEach, n as aroundAll, o as aroundEach, q as beforeAll, t as beforeEach, u as describe, v as it, w as onTestFailed, x as onTestFinished, r as recordArtifact, y as suite, z as test } from './chunks/run.CjdgFZiW.js';
4
4
  export { expectTypeOf } from 'expect-type';
5
5
  import * as chai from 'chai';
6
6
  export { chai };
7
7
  import './chunks/utils.DYj33du9.js';
8
- import './chunks/source-map.DdKI5IHB.js';
8
+ import './chunks/source-map.DakdQc29.js';
9
9
  import './chunks/index.D0heQG4v.js';
10
10
  import './chunks/tinyrainbow.Do8I1XRG.js';
11
- import './chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
11
+ import './chunks/pathe.M-eThtNZ.zq3TM4NT.js';
12
12
  import './chunks/spy.DDMXghXv.js';
13
13
  import './chunks/display.BlTmubjj.js';
14
14
  import './task-utils.js';
15
15
  import './chunks/plugins.DPQHVT0p.js';
16
+ import './chunks/rawSnapshot.DqSiqIEx.js';
16
17
  import './chunks/offset.Dy-5Fdfn.js';
17
18
  import 'tinybench';
18
19
  import 'vite/module-runner';
@@ -1,9 +1,9 @@
1
1
  import { ModuleEvaluator, ModuleRunnerImportMeta, ModuleRunnerContext, EvaluatedModuleNode } from 'vite/module-runner';
2
- import { G as GetterTracker } from './chunks/rpc.d.Cft1biqy.js';
2
+ import { G as GetterTracker } from './chunks/rpc.d.3FOhdFx8.js';
3
3
  import { RuntimeRPC } from './index.js';
4
4
  import { EvaluatedModules as VitestEvaluatedModules } from './index.js';
5
5
  import vm from 'node:vm';
6
- import './chunks/config.d.QBNYCgFU.js';
6
+ import './chunks/config.d.B3YV4t0O.js';
7
7
  import 'vitest/optional-runtime-types.js';
8
8
  import 'tinybench';
9
9
 
@@ -108,6 +108,7 @@ declare class ExternalModulesExecutor {
108
108
  readonly codeCache: CodeCache | undefined;
109
109
  private resolvers;
110
110
  constructor(options: ExternalModulesExecutorOptions);
111
+ syncBuiltinESMExports(): void;
111
112
  import(identifier: string): Promise<object>;
112
113
  require(identifier: string): any;
113
114
  createRequire(identifier: string): NodeJS.Require;
package/dist/node.d.ts CHANGED
@@ -3,31 +3,31 @@ import { UserConfig as UserConfig$1, ResolvedConfig as ResolvedConfig$1, Transfo
3
3
  export { vite as Vite };
4
4
  export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
5
5
  import { IncomingMessage } from 'node:http';
6
- import { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as ReportContext, j as TestProject, k as VitestOptions, l as VitestRunMode, m as TestSpecification, n as PoolWorker, o as PoolOptions, p as WorkerRequest, q as TestSequencer } from './chunks/plugin.d.C8mmycim.js';
7
- export { M as AgentReporter, B as BaseCoverageOptions, r as BaseReporter, s as BenchmarkUserOptions, t as BrowserBuiltinProvider, u as BrowserCommand, v as BrowserCommandContext, w as BrowserConfigOptions, x as BrowserInstanceOption, y as BrowserModuleMocker, z as BrowserOrchestrator, D as BrowserProvider, E as BrowserProviderCloseOptions, G as BrowserProviderOption, H as BrowserScript, J as BrowserServerContribution, K as BrowserServerFactory, N as BrowserServerState, O as BrowserServerStateSession, Q as BrowserTraceViewOptions, S as BuiltinEnvironment, X as BuiltinReporterOptions, Y as BuiltinReporters, Z as CSSModuleScopeStrategy, _ as CacheKeyIdGenerator, $ as CacheKeyIdGeneratorContext, a0 as CachedTestFileResult, a1 as CoverageInstrumenter, a2 as CoverageIstanbulOptions, C as CoverageOptions, a3 as CoverageProvider, a4 as CoverageProviderModule, a5 as CoverageReporter, a6 as CoverageV8Options, a7 as CustomProviderOptions, a8 as DefaultReporter, a9 as DepsOptimizationOptions, aa as DotReporter, ab as EnvironmentOptions, ac as GithubActionsReporter, ad as HTMLOptions, ae as HangingProcessReporter, I as InlineConfig, af as InstrumenterOptions, ag as JUnitOptions, ah as JUnitReporter, ai as JsonAssertionResult, aj as JsonOptions, ak as JsonReporter, al as JsonTestResult, am as JsonTestResults, M as MinimalReporter, an as ModuleDiagnostic, ao as OnServerRestartHandler, ap as OnTestsRerunHandler, aq as ParentProjectBrowser, ar as Pool, as as PoolRunnerInitializer, at as PoolTask, au as ProjectBrowser, av as ProjectConfig, aw as Report, ax as ReportedHookContext, ay as Reporter, az as ReportersMap, aA as ResolveSnapshotPathHandler, aB as ResolveSnapshotPathHandlerContext, aC as ResolvedBrowserOptions, aD as ResolvedProjectConfig, aE as SerializedTestProject, aF as SuiteNameTemplateVariables, aG as TapFlatReporter, aH as TapReporter, aI as TaskOptions, aJ as TestCase, aK as TestCollection, aL as TestDiagnostic, aM as TestModule, aN as TestModuleState, aO as TestResult, aP as TestResultFailed, aQ as TestResultPassed, aR as TestResultPending, aS as TestResultSkipped, aT as TestRunEndReason, aU as TestRunResult, aV as TestSequencerConstructor, aW as TestSpecificationOptions, aX as TestState, aY as TestSuite, aZ as TestSuiteState, a_ as ToMatchScreenshotComparators, a$ as ToMatchScreenshotOptions, b0 as TypecheckConfig, b1 as UIOptions, U as UserWorkspaceConfig, b2 as VerboseReporter, b3 as VitestEnvironment, b4 as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, b5 as WorkerResponse, b6 as _BrowserNames, b7 as experimental_getRunnerTask, b8 as startVitest } from './chunks/plugin.d.C8mmycim.js';
6
+ import { R as ResolvedConfig, e as CliOptions, d as UserConfig, L as Logger, A as ApiConfig, P as PluginHarness, f as Vitest, g as ResolvedCoverageOptions, h as CoverageMap, i as TestSpecification, j as ReportContext, k as TestProject, l as VitestOptions, m as VitestRunMode, n as VCSProvider, o as VCSProviderOptions, p as PoolWorker, q as PoolOptions, r as WorkerRequest, s as TestSequencer } from './chunks/plugin.d.LRFSN46m.js';
7
+ export { M as AgentReporter, B as BaseCoverageOptions, t as BaseReporter, u as BenchmarkUserOptions, v as BrowserBuiltinProvider, w as BrowserCommand, x as BrowserCommandContext, y as BrowserConfigOptions, z as BrowserInstanceOption, D as BrowserModuleMocker, E as BrowserOrchestrator, G as BrowserProvider, H as BrowserProviderCloseOptions, J as BrowserProviderOption, K as BrowserScript, N as BrowserServerContribution, O as BrowserServerFactory, Q as BrowserServerState, S as BrowserServerStateSession, X as BrowserTraceViewOptions, Y as BuiltinEnvironment, Z as BuiltinReporterOptions, _ as BuiltinReporters, $ as CSSModuleScopeStrategy, a0 as CacheKeyIdGenerator, a1 as CacheKeyIdGeneratorContext, a2 as CachedTestFileResult, a3 as CoverageInstrumenter, a4 as CoverageIstanbulOptions, C as CoverageOptions, a5 as CoverageProvider, a6 as CoverageProviderModule, a7 as CoverageReporter, a8 as CoverageV8Options, a9 as CustomProviderOptions, aa as DefaultReporter, ab as DepsOptimizationOptions, ac as DotReporter, ad as EnvironmentOptions, ae as GithubActionsReporter, af as HTMLOptions, ag as HangingProcessReporter, I as InlineConfig, ah as InstrumenterOptions, ai as JUnitOptions, aj as JUnitReporter, ak as JsonAssertionResult, al as JsonOptions, am as JsonReporter, an as JsonTestResult, ao as JsonTestResults, M as MinimalReporter, ap as ModuleDependency, aq as ModuleDiagnostic, ar as ModulesResolver, as as OnServerRestartHandler, at as OnTestsRerunHandler, au as ParentProjectBrowser, av as Pool, aw as PoolRunnerInitializer, ax as PoolTask, ay as ProjectBrowser, az as ProjectConfig, aA as Report, aB as ReportedHookContext, aC as Reporter, aD as ReportersMap, aE as ResolveSnapshotPathHandler, aF as ResolveSnapshotPathHandlerContext, aG as ResolvedBrowserOptions, aH as ResolvedProjectConfig, aI as SerializedTestProject, aJ as SuiteNameTemplateVariables, aK as TapFlatReporter, aL as TapReporter, aM as TaskOptions, aN as TestAttempt, aO as TestAttemptState, aP as TestCase, aQ as TestCollection, aR as TestDiagnostic, aS as TestModule, aT as TestModuleState, aU as TestResult, aV as TestResultFailed, aW as TestResultPassed, aX as TestResultPending, aY as TestResultSkipped, aZ as TestRunEndReason, a_ as TestRunResult, a$ as TestSequencerConstructor, b0 as TestSpecificationOptions, b1 as TestState, b2 as TestSuite, b3 as TestSuiteState, b4 as ToMatchScreenshotComparators, b5 as ToMatchScreenshotOptions, b6 as TypecheckConfig, b7 as UIOptions, U as UserWorkspaceConfig, b8 as VerboseReporter, b9 as VitestEnvironment, ba as VitestPackageInstaller, V as VitestPluginContext, W as WatcherTriggerPattern, bb as WorkerResponse, bc as _BrowserNames, bd as experimental_getRunnerTask, be as startVitest } from './chunks/plugin.d.LRFSN46m.js';
8
8
  import { EventEmitter } from 'events';
9
- import { A as Awaitable } from './chunks/config.d.QBNYCgFU.js';
9
+ import { A as Awaitable } from './chunks/config.d.B3YV4t0O.js';
10
10
  import { AfterSuiteRunMeta } from './index.js';
11
- export { X as RunnerTask, aH as RunnerTaskResult, j as RunnerTaskResultPack, m as RunnerTestCase, a as RunnerTestFile, O as RunnerTestSuite, aI as RuntimeConfig, bf as SequenceHooks, bg as SequenceSetupFiles, aJ as SerializedError, bh as disableDefaultColors } from './chunks/config.d.QBNYCgFU.js';
11
+ export { Y as RunnerTask, aI as RunnerTaskResult, k as RunnerTaskResultPack, n as RunnerTestCase, a as RunnerTestFile, Q as RunnerTestSuite, aK as RuntimeConfig, bh as SequenceHooks, bi as SequenceSetupFiles, aL as SerializedError, bj as disableDefaultColors } from './chunks/config.d.B3YV4t0O.js';
12
12
  import { RuntimeRPC } from './index.js';
13
13
  import { Writable } from 'node:stream';
14
14
  import { ContextRPC } from './index.js';
15
- export { T as TestExecutionType } from './chunks/worker.d.BH-r1bPu.js';
15
+ export { T as TestExecutionType } from './chunks/worker.d.CyJRpyfZ.js';
16
16
  import { Debugger } from 'obug';
17
- export { g as generateFileHash } from './chunks/task-utils.d.PFh2BV6Q.js';
17
+ export { g as generateFileHash } from './chunks/task-utils.d.D-gFPNFi.js';
18
18
  export { CDPSession } from 'vitest/browser';
19
- import './chunks/browser.d.FGQ9_rK6.js';
19
+ import './chunks/browser.d.C7tWgUvw.js';
20
20
  import 'chai';
21
21
  import 'vitest/optional-types.js';
22
22
  import '@vitest/mocker';
23
- import './chunks/source-map.d.kzFtk_dj.js';
23
+ import './chunks/source-map.d.BkG8YK_3.js';
24
24
  import 'node:path';
25
25
  import 'node:console';
26
26
  import 'node:fs/promises';
27
27
  import 'vitest/optional-runtime-types.js';
28
28
  import 'tinybench';
29
29
  import 'vite/module-runner';
30
- import './chunks/environment.d.BY56MoGs.js';
30
+ import './chunks/environment.d.BFQtFKdZ.js';
31
31
 
32
32
  declare function escapeTestName(label: string, dynamic: boolean): string;
33
33
 
@@ -249,7 +249,7 @@ declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
249
249
  };
250
250
 
251
251
  declare function resolveApiServerConfig(config: UserConfig, defaultPort: number, logger: Logger): ApiConfig;
252
- declare function resolveConfig(options?: UserConfig, viteOverrides?: UserConfig$1, pluginsHarness?: PluginHarness): Promise<ResolvedConfig$1>;
252
+ declare function resolveConfig(options?: UserConfig, viteOverrides?: UserConfig$1, pluginsHarness?: PluginHarness, cliFilters?: string[]): Promise<ResolvedConfig$1>;
253
253
 
254
254
  type Threshold = "lines" | "functions" | "statements" | "branches";
255
255
  interface ResolvedThreshold {
@@ -329,7 +329,7 @@ declare class BaseCoverageProvider {
329
329
  };
330
330
  }): Promise<void>;
331
331
  cleanAfterRun(): Promise<void>;
332
- onTestRunStart(): Promise<void>;
332
+ onTestRunStart(specifications: ReadonlyArray<TestSpecification>): Promise<void>;
333
333
  onTestFailure(): Promise<void>;
334
334
  reportCoverage(coverageMap: unknown, { allTestsRun }: ReportContext): Promise<void>;
335
335
  reportThresholds(coverageMap: CoverageMap, allTestsRun: boolean | undefined): Promise<void>;
@@ -404,6 +404,24 @@ interface MethodsOptions {
404
404
  }
405
405
  declare function createMethodsRPC(project: TestProject, methodsOptions?: MethodsOptions): RuntimeRPC;
406
406
 
407
+ declare class GitVCSProvider implements VCSProvider {
408
+ private root;
409
+ private resolveFilesWithGitCommand;
410
+ findChangedFiles(options: VCSProviderOptions): Promise<string[]>;
411
+ private getFilesSince;
412
+ private getStagedFiles;
413
+ private getUnstagedFiles;
414
+ getRoot(cwd: string): Promise<string | null>;
415
+ }
416
+
417
+ /**
418
+ * Reports a dependency as changed when its modification time is newer than the run that recorded it.
419
+ * A dependency without a recorded time is always changed.
420
+ */
421
+ declare class MtimeVCSProvider implements VCSProvider {
422
+ findChangedFiles(options: VCSProviderOptions): Promise<string[]>;
423
+ }
424
+
407
425
  /** @experimental */
408
426
  declare class ForksPoolWorker implements PoolWorker {
409
427
  readonly name: string;
@@ -511,5 +529,5 @@ declare const createViteServer: typeof vite.createServer;
511
529
 
512
530
  declare const rolldownVersion: string | undefined;
513
531
 
514
- export { ApiConfig, BaseCoverageProvider, BaseSequencer, BrowserConnectionError, CliOptions, ForksPoolWorker, GitNotFoundError, Logger, PluginHarness, PoolOptions, PoolWorker, ReportContext, ResolvedConfig, ResolvedCoverageOptions, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, Vitest, VitestOptions, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createCLI, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isFileServingAllowed, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, version };
532
+ export { ApiConfig, BaseCoverageProvider, BaseSequencer, BrowserConnectionError, CliOptions, ForksPoolWorker, GitNotFoundError, GitVCSProvider, Logger, MtimeVCSProvider, PluginHarness, PoolOptions, PoolWorker, ReportContext, ResolvedConfig, ResolvedCoverageOptions, TestProject, TestSequencer, TestSpecification, UserConfig as TestUserConfig, FilesNotFoundError as TestsNotFoundError, ThreadsPoolWorker, TypecheckPoolWorker, VCSProvider, VCSProviderOptions, Vitest, VitestOptions, VitestRunMode, VmForksPoolWorker, VmThreadsPoolWorker, WorkerRequest, createCLI, createDebugger, createMethodsRPC, createViteLogger, createViteServer, createVitest, distDir, escapeTestName, getFilePoolName, isFileServingAllowed, isValidApiRequest, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rolldownVersion, rootDir, version };
515
533
  export type { CliParseOptions, ProcessPool, CollectLineNumbers as TypeCheckCollectLineNumbers, CollectLines as TypeCheckCollectLines, Context as TypeCheckContext, TscErrorInfo as TypeCheckErrorInfo, RawErrsMap as TypeCheckRawErrorsMap, RootAndTarget as TypeCheckRootAndTarget, WorkerContext };
package/dist/node.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import * as vite from 'vite';
2
2
  export { esbuildVersion, isCSSRequest, isFileLoadingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
3
- import { V as Vitest } from './chunks/cli-api.De07GUeT.js';
4
- export { M as AgentReporter, B as BaseCoverageProvider, D as DefaultReporter, a as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, b as JsonReporter, M as MinimalReporter, R as ReportersMap, T as TapFlatReporter, c as TapReporter, d as VerboseReporter, e as createVitest, f as experimental_getRunnerTask, i as isValidApiRequest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.De07GUeT.js';
5
- export { B as BaseSequencer, a as BrowserConnectionError, F as ForksPoolWorker, G as GitNotFoundError, L as Logger, P as PluginHarness, b as TestsNotFoundError, T as ThreadsPoolWorker, c as TypecheckPoolWorker, V as VitestPackageInstaller, d as VmForksPoolWorker, e as VmThreadsPoolWorker, f as createDebugger, g as createMethodsRPC, h as createViteLogger, i as escapeTestName, j as getFilePoolName, k as isFileServingAllowed, r as resolveApiServerConfig, l as resolveConfig, m as resolveFsAllow } from './chunks/index.1TqnEahn.js';
6
- export { c as createCLI, p as parseCLI } from './chunks/cac.CLrZKo1g.js';
3
+ import { V as Vitest } from './chunks/cli-api.COfZo8lK.js';
4
+ export { M as AgentReporter, B as BaseCoverageProvider, D as DefaultReporter, a as DotReporter, G as GitVCSProvider, b as GithubActionsReporter, H as HangingProcessReporter, J as JUnitReporter, c as JsonReporter, M as MinimalReporter, d as MtimeVCSProvider, R as ReportersMap, T as TapFlatReporter, e as TapReporter, f as VerboseReporter, g as createVitest, h as experimental_getRunnerTask, i as isValidApiRequest, r as registerConsoleShortcuts, s as startVitest } from './chunks/cli-api.COfZo8lK.js';
5
+ export { B as BaseSequencer, a as BrowserConnectionError, F as ForksPoolWorker, G as GitNotFoundError, L as Logger, P as PluginHarness, b as TestsNotFoundError, T as ThreadsPoolWorker, c as TypecheckPoolWorker, V as VitestPackageInstaller, d as VmForksPoolWorker, e as VmThreadsPoolWorker, f as createDebugger, g as createMethodsRPC, h as createViteLogger, i as escapeTestName, j as getFilePoolName, k as isFileServingAllowed, r as resolveApiServerConfig, l as resolveConfig, m as resolveFsAllow } from './chunks/index.Di8au7q4.js';
6
+ export { c as createCLI, p as parseCLI } from './chunks/cac.BYbt0aJp.js';
7
7
  export { distDir, rootDir } from './path.js';
8
8
  export { generateFileHash } from './task-utils.js';
9
9
  export { w as disableDefaultColors } from './chunks/tinyrainbow.Do8I1XRG.js';
10
10
  import 'node:fs';
11
- import './chunks/coverage.cTDc4uSS.js';
12
- import './chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
11
+ import './chunks/coverage.jGCktcGP.js';
12
+ import './chunks/pathe.M-eThtNZ.zq3TM4NT.js';
13
13
  import 'node:fs/promises';
14
14
  import 'node:os';
15
- import './chunks/source-map.DdKI5IHB.js';
15
+ import './chunks/source-map.DakdQc29.js';
16
16
  import './chunks/index.D0heQG4v.js';
17
17
  import 'node:perf_hooks';
18
18
  import './chunks/index.DmDMHCg8.js';
@@ -27,13 +27,13 @@ import 'url';
27
27
  import 'zlib';
28
28
  import 'buffer';
29
29
  import 'util';
30
- import './chunks/constants.-juJ8b_4.js';
30
+ import './chunks/constants.DLYM6cZY.js';
31
31
  import './chunks/modules.BJuCwlRJ.js';
32
32
  import 'node:module';
33
33
  import 'node:crypto';
34
- import './chunks/run.BPv-BBRv.js';
34
+ import './chunks/run.CjdgFZiW.js';
35
35
  import './chunks/display.BlTmubjj.js';
36
- import './chunks/nativeModuleRunner.xi64Afb2.js';
36
+ import './chunks/nativeModuleRunner.9xPIMzi7.js';
37
37
  import 'node:url';
38
38
  import 'node:path';
39
39
  import 'node:process';
@@ -42,24 +42,26 @@ import 'node:v8';
42
42
  import 'node:util';
43
43
  import 'vite/module-runner';
44
44
  import './traces.js';
45
+ import './chunks/utils.BBk_icFG.js';
45
46
  import 'picomatch';
46
47
  import 'tinyglobby';
47
48
  import './chunks/defaults.B1FCaFfh.js';
48
49
  import './chunks/env.BKKtU2WC.js';
49
50
  import 'std-env';
50
- import './chunks/utils.DSfl_w8V.js';
51
51
  import 'tinyexec';
52
52
  import 'node:readline';
53
+ import './chunks/rawSnapshot.DqSiqIEx.js';
54
+ import './chunks/offset.Dy-5Fdfn.js';
55
+ import './chunks/plugins.DPQHVT0p.js';
53
56
  import 'magic-string';
54
57
  import '@vitest/mocker/node';
55
58
  import 'node:console';
56
59
  import 'node:stream';
57
60
  import 'obug';
58
- import './chunks/resolver.CtCcxIy1.js';
61
+ import './chunks/resolver.BzpmeQeT.js';
59
62
  import 'es-module-lexer';
60
- import './chunks/offset.Dy-5Fdfn.js';
61
63
  import '#module-evaluator';
62
- import './chunks/module-dependencies.CwNPkcV4.js';
64
+ import './chunks/module-dependencies._2Eei3FO.js';
63
65
  import 'node:tty';
64
66
  import 'node:events';
65
67
  import 'node:child_process';
package/dist/runtime.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { E as Environment } from './chunks/environment.d.BY56MoGs.js';
2
- export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.BY56MoGs.js';
3
- import { br as SnapshotEnvironment, bs as SnapshotEnvironmentOptions } from './chunks/config.d.QBNYCgFU.js';
4
- export { b as SerializedConfig, V as VitestRunner } from './chunks/config.d.QBNYCgFU.js';
1
+ import { E as Environment } from './chunks/environment.d.BFQtFKdZ.js';
2
+ export { a as EnvironmentReturn, V as VmEnvironmentReturn } from './chunks/environment.d.BFQtFKdZ.js';
3
+ import { bu as SnapshotEnvironment, bv as SnapshotEnvironmentOptions } from './chunks/config.d.B3YV4t0O.js';
4
+ export { b as SerializedConfig, V as VitestRunner } from './chunks/config.d.B3YV4t0O.js';
5
5
  import 'vitest/optional-runtime-types.js';
6
6
  import 'tinybench';
7
7
 
package/dist/runtime.js CHANGED
@@ -1,18 +1,19 @@
1
1
  import { VitestModuleEvaluator } from './module-evaluator.js';
2
- import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/index.CK-t0WMg.js';
3
- export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.CK-t0WMg.js';
2
+ import { V as VITEST_VM_CONTEXT_SYMBOL, s as startVitestModuleRunner, a as VitestModuleRunner } from './chunks/index.Bi0NXYPf.js';
3
+ export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.Bi0NXYPf.js';
4
4
  import { g as getWorkerState } from './chunks/utils.DYj33du9.js';
5
- export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.uQulW0ei.js';
5
+ export { VitestNodeSnapshotEnvironment as VitestSnapshotEnvironment } from './chunks/node.B9mkVmLH.js';
6
6
  import 'node:module';
7
7
  import 'node:url';
8
8
  import 'node:vm';
9
9
  import 'vite/module-runner';
10
10
  import './traces.js';
11
11
  import 'node:fs';
12
- import './chunks/pathe.M-eThtNZ.Ba-7h1rE.js';
12
+ import './chunks/pathe.M-eThtNZ.zq3TM4NT.js';
13
13
  import './chunks/modules.BJuCwlRJ.js';
14
14
  import './path.js';
15
15
  import 'node:path';
16
+ import 'node:async_hooks';
16
17
  import '@vitest/mocker';
17
18
  import '@vitest/mocker/redirect';
18
19
  import 'node:console';