vitest 0.24.3 → 0.24.5

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 (35) hide show
  1. package/dist/browser.d.ts +3 -3
  2. package/dist/browser.js +8 -7
  3. package/dist/{chunk-api-setup.cdeaef6b.js → chunk-api-setup.629f8133.js} +4 -4
  4. package/dist/{chunk-integrations-globals.10e6725a.js → chunk-integrations-globals.32ef80c3.js} +6 -6
  5. package/dist/{chunk-mock-date.9fe2b438.js → chunk-mock-date.030959d3.js} +1 -1
  6. package/dist/{chunk-runtime-chain.072b5677.js → chunk-runtime-chain.37ec5d73.js} +40 -9
  7. package/dist/chunk-runtime-error.17751c39.js +135 -0
  8. package/dist/{chunk-runtime-hooks.6963ff8f.js → chunk-runtime-hooks.d748b085.js} +4 -4
  9. package/dist/{chunk-runtime-mocker.3eb1fcc0.js → chunk-runtime-mocker.41b92ec9.js} +3 -3
  10. package/dist/chunk-runtime-rpc.b418c0ab.js +30 -0
  11. package/dist/{chunk-runtime-error.b043a88d.js → chunk-runtime-setup.ab6b6274.js} +11 -142
  12. package/dist/chunk-utils-source-map.663e2952.js +3429 -0
  13. package/dist/{chunk-utils-source-map.d9d36eb0.js → chunk-utils-timers.8fca243e.js} +19 -3439
  14. package/dist/{chunk-vite-node-client.e22799cd.js → chunk-vite-node-client.3868b3ba.js} +10 -12
  15. package/dist/{chunk-vite-node-externalize.efa824b9.js → chunk-vite-node-externalize.d9033432.js} +28 -24
  16. package/dist/{chunk-vite-node-utils.835c8b2c.js → chunk-vite-node-utils.2144000e.js} +14 -11
  17. package/dist/cli-wrapper.js +4 -0
  18. package/dist/cli.js +14 -8
  19. package/dist/config.cjs +3 -4
  20. package/dist/config.d.ts +1 -1
  21. package/dist/config.js +3 -4
  22. package/dist/entry.js +8 -7
  23. package/dist/environments.d.ts +1 -1
  24. package/dist/{global-732f9b14.d.ts → global-58e8e951.d.ts} +5 -0
  25. package/dist/{index-40e0cb97.d.ts → index-220c1d70.d.ts} +1 -1
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +6 -6
  28. package/dist/loader.js +3 -3
  29. package/dist/node.d.ts +2 -2
  30. package/dist/node.js +7 -7
  31. package/dist/suite.js +5 -5
  32. package/dist/worker.js +9 -7
  33. package/package.json +8 -7
  34. package/dist/chunk-runtime-rpc.e583f5e7.js +0 -16
  35. package/dist/chunk-utils-timers.ab764c0c.js +0 -27
@@ -2,7 +2,7 @@ import { createRequire } from 'module';
2
2
  import { pathToFileURL, fileURLToPath } from 'url';
3
3
  import vm from 'vm';
4
4
  import { b as resolve, d as dirname, g as isAbsolute, l as extname } from './chunk-utils-env.b1281522.js';
5
- import { s as slash, n as normalizeRequestId, b as toFilePath, i as isNodeBuiltin, c as isPrimitive, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.835c8b2c.js';
5
+ import { s as slash, n as normalizeRequestId, b as toFilePath, i as isNodeBuiltin, c as isPrimitive, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.2144000e.js';
6
6
  import createDebug from 'debug';
7
7
 
8
8
  const debugExecute = createDebug("vite-node:client:execute");
@@ -190,18 +190,16 @@ ${getStack()}`), 2e3);
190
190
  return Reflect.get(exports, p, receiver);
191
191
  },
192
192
  set(_, p, value) {
193
- if (p !== "default") {
194
- if (!Reflect.has(exports, "default"))
195
- exports.default = {};
196
- if (exports.default === null || typeof exports.default !== "object") {
197
- defineExport(exports, p, () => void 0);
198
- return true;
199
- }
200
- exports.default[p] = value;
201
- defineExport(exports, p, () => value);
193
+ if (!Reflect.has(exports, "default"))
194
+ exports.default = {};
195
+ if (exports.default === null || typeof exports.default !== "object") {
196
+ defineExport(exports, p, () => void 0);
202
197
  return true;
203
198
  }
204
- return Reflect.set(exports, p, value);
199
+ exports.default[p] = value;
200
+ if (p !== "default")
201
+ defineExport(exports, p, () => value);
202
+ return true;
205
203
  }
206
204
  });
207
205
  Object.assign(mod, { code: transformed, exports });
@@ -209,7 +207,7 @@ ${getStack()}`), 2e3);
209
207
  const moduleProxy = {
210
208
  set exports(value) {
211
209
  exportAll(cjsExports, value);
212
- cjsExports.default = value;
210
+ exports.default = value;
213
211
  },
214
212
  get exports() {
215
213
  return cjsExports;
@@ -1,7 +1,7 @@
1
1
  import { b as resolve, p as picocolors, j as join, c as basename, d as dirname, e as distDir, f as rootDir, g as isAbsolute, r as relative, i as isNode, h as configFiles, k as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-utils-env.b1281522.js';
2
2
  import { p as pLimit, g as getCoverageProvider, C as CoverageProviderMap } from './chunk-integrations-coverage.cca09977.js';
3
3
  import { g as getEnvPackageName } from './chunk-env-node.700b7e95.js';
4
- import { A as AggregateErrorPonyfill, s as slash$2, o as relativePath, x as getTests, e as getFullName, v as hasFailed, y as hasFailedSnapshot, z as getSuites, j as notNullish, q as shuffle, t as toArray$1, n as noop$1, B as deepMerge, b as getCallLastIndex, C as ensurePackageInstalled, D as stdout } from './chunk-mock-date.9fe2b438.js';
4
+ import { A as AggregateErrorPonyfill, s as slash$2, k as relativePath, x as getTests, e as getFullName, q as hasFailed, y as hasFailedSnapshot, z as getSuites, j as notNullish, l as shuffle, t as toArray$1, n as noop$1, B as deepMerge, b as getCallLastIndex, C as ensurePackageInstalled, D as stdout } from './chunk-mock-date.030959d3.js';
5
5
  import { loadConfigFromFile, normalizePath, createServer, mergeConfig } from 'vite';
6
6
  import path$a from 'path';
7
7
  import url, { fileURLToPath } from 'url';
@@ -12,14 +12,14 @@ import util$2 from 'util';
12
12
  import require$$0$1 from 'stream';
13
13
  import require$$2 from 'events';
14
14
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
15
- import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.e22799cd.js';
15
+ import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.3868b3ba.js';
16
16
  import { performance } from 'perf_hooks';
17
17
  import createDebug from 'debug';
18
- import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.835c8b2c.js';
18
+ import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.2144000e.js';
19
19
  import { MessageChannel } from 'worker_threads';
20
20
  import { Tinypool } from 'tinypool';
21
- import { c as stripAnsi, d as cliTruncate, p as parseStacktrace, i as interpretSourcePos, e as stringWidth, h as ansiStyles, j as sliceAnsi, s as stringify$5, u as unifiedDiff, b as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.d9d36eb0.js';
22
- import { b as safeSetInterval, c as safeClearInterval, s as safeSetTimeout, a as safeClearTimeout } from './chunk-utils-timers.ab764c0c.js';
21
+ import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.8fca243e.js';
22
+ import { p as parseStacktrace, i as interpretSourcePos, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.663e2952.js';
23
23
  import { resolveModule } from 'local-pkg';
24
24
  import { createHash } from 'crypto';
25
25
  import { o as onetime } from './vendor-index.9c919048.js';
@@ -29,7 +29,7 @@ import { stripLiteral } from 'strip-literal';
29
29
  import require$$0$2 from 'readline';
30
30
  import { p as prompts } from './vendor-index.9f20a9be.js';
31
31
 
32
- var version$1 = "0.24.3";
32
+ var version$1 = "0.24.5";
33
33
 
34
34
  class EndError extends Error {
35
35
  constructor(value) {
@@ -7582,9 +7582,9 @@ ${BADGE}${TRIGGER} ${picocolors.exports.blue(`x${rerun}`)}
7582
7582
  var _a2, _b;
7583
7583
  if (this.ctx.config.silent)
7584
7584
  return false;
7585
- const shouldIgnore = (_b = (_a2 = this.ctx.config).onConsoleLog) == null ? void 0 : _b.call(_a2, log.content, log.type);
7586
- if (shouldIgnore === false)
7587
- return shouldIgnore;
7585
+ const shouldLog = (_b = (_a2 = this.ctx.config).onConsoleLog) == null ? void 0 : _b.call(_a2, log.content, log.type);
7586
+ if (shouldLog === false)
7587
+ return shouldLog;
7588
7588
  return true;
7589
7589
  }
7590
7590
  onServerRestart(reason) {
@@ -8660,7 +8660,7 @@ class StateManager {
8660
8660
  }
8661
8661
 
8662
8662
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
8663
- const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
8663
+ const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*"];
8664
8664
  const benchmarkConfigDefaults = {
8665
8665
  include: ["**/*.{bench,benchmark}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
8666
8666
  exclude: defaultExclude,
@@ -8678,7 +8678,7 @@ const defaultCoverageExcludes = [
8678
8678
  "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
8679
8679
  "**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
8680
8680
  "**/__tests__/**",
8681
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}",
8681
+ "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*",
8682
8682
  "**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
8683
8683
  ];
8684
8684
  const coverageConfigDefaults = {
@@ -8724,8 +8724,7 @@ const config = {
8724
8724
  watchExclude: ["**/node_modules/**", "**/dist/**"],
8725
8725
  forceRerunTriggers: [
8726
8726
  "**/package.json/**",
8727
- "**/vitest.config.*/**",
8728
- "**/vite.config.*/**"
8727
+ "**/{vitest,vite}.config.*/**"
8729
8728
  ],
8730
8729
  update: false,
8731
8730
  reporters: [],
@@ -9533,7 +9532,7 @@ createLogUpdate(process$1.stdout);
9533
9532
 
9534
9533
  createLogUpdate(process$1.stderr);
9535
9534
 
9536
- var version = "0.24.3";
9535
+ var version = "0.24.5";
9537
9536
 
9538
9537
  function fileFromParsedStack(stack) {
9539
9538
  var _a, _b;
@@ -9592,8 +9591,6 @@ function printErrorType(type, ctx) {
9592
9591
  ${picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` ${type} `))))}`);
9593
9592
  }
9594
9593
  const skipErrorProperties = [
9595
- "message",
9596
- "name",
9597
9594
  "nameStr",
9598
9595
  "stack",
9599
9596
  "cause",
@@ -9603,8 +9600,8 @@ const skipErrorProperties = [
9603
9600
  "showDiff",
9604
9601
  "actual",
9605
9602
  "expected",
9606
- "constructor",
9607
- "toString"
9603
+ ...Object.getOwnPropertyNames(Error.prototype),
9604
+ ...Object.getOwnPropertyNames(Object.prototype)
9608
9605
  ];
9609
9606
  function getErrorProperties(e) {
9610
9607
  const errorObject = /* @__PURE__ */ Object.create(null);
@@ -9746,11 +9743,11 @@ class Logger {
9746
9743
  this._clearScreen();
9747
9744
  }
9748
9745
  _clearScreen() {
9749
- if (!this._clearScreenPending)
9746
+ if (this._clearScreenPending == null)
9750
9747
  return;
9751
9748
  const log = this._clearScreenPending;
9752
9749
  this._clearScreenPending = void 0;
9753
- this.console.log(`\x1B[1;1H\x1B[J${log}`);
9750
+ this.console.log(`\x1Bc${log}`);
9754
9751
  }
9755
9752
  printError(err, fullStack = false, type) {
9756
9753
  return printError(err, this.ctx, {
@@ -9779,7 +9776,7 @@ No ${config.mode} files found, exiting with code 1`));
9779
9776
  }
9780
9777
  printBanner() {
9781
9778
  var _a, _b, _c;
9782
- this.log();
9779
+ this.clearScreen("", true);
9783
9780
  const versionTest = this.ctx.config.watch ? picocolors.exports.blue(`v${version}`) : picocolors.exports.cyan(`v${version}`);
9784
9781
  const mode = this.ctx.config.watch ? picocolors.exports.blue(" DEV ") : picocolors.exports.cyan(" RUN ");
9785
9782
  this.log(`${picocolors.exports.inverse(picocolors.exports.bold(mode))} ${versionTest} ${picocolors.exports.gray(this.ctx.config.root)}`);
@@ -9902,6 +9899,10 @@ class Vitest {
9902
9899
  sequence: {
9903
9900
  ...this.config.sequence,
9904
9901
  sequencer: void 0
9902
+ },
9903
+ benchmark: {
9904
+ ...this.config.benchmark,
9905
+ reporters: []
9905
9906
  }
9906
9907
  },
9907
9908
  this.configOverride || {}
@@ -10569,7 +10570,9 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
10569
10570
  const config = {
10570
10571
  resolve: {
10571
10572
  mainFields: [],
10572
- alias: preOptions.alias
10573
+ alias: preOptions.alias,
10574
+ conditions: ["node"],
10575
+ browserField: false
10573
10576
  },
10574
10577
  server: {
10575
10578
  ...preOptions.api,
@@ -10626,7 +10629,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
10626
10629
  try {
10627
10630
  await ctx.setServer(options, server);
10628
10631
  if (options.api && options.watch)
10629
- (await import('./chunk-api-setup.cdeaef6b.js')).setup(ctx);
10632
+ (await import('./chunk-api-setup.629f8133.js')).setup(ctx);
10630
10633
  } catch (err) {
10631
10634
  ctx.logger.printError(err, true);
10632
10635
  process.exit(1);
@@ -10707,12 +10710,13 @@ function registerConsoleShortcuts(ctx) {
10707
10710
  await _keypressHandler(str, key);
10708
10711
  }
10709
10712
  async function inputNamePattern() {
10713
+ var _a;
10710
10714
  off();
10711
10715
  const { filter = "" } = await prompts([{
10712
10716
  name: "filter",
10713
10717
  type: "text",
10714
10718
  message: "Input test name pattern (RegExp)",
10715
- initial: String(ctx.config.testNamePattern || "")
10719
+ initial: ((_a = ctx.config.testNamePattern) == null ? void 0 : _a.source) || ""
10716
10720
  }]);
10717
10721
  await ctx.changeNamePattern(filter, void 0, "change pattern");
10718
10722
  on();
@@ -1,7 +1,7 @@
1
1
  import { pathToFileURL, fileURLToPath as fileURLToPath$1, URL as URL$1 } from 'url';
2
+ import fs, { promises, statSync, existsSync, realpathSync, Stats } from 'fs';
2
3
  import { b as resolve$1, r as relative } from './chunk-utils-env.b1281522.js';
3
4
  import { builtinModules } from 'module';
4
- import fs, { promises, statSync, existsSync, realpathSync, Stats } from 'fs';
5
5
  import path from 'path';
6
6
  import assert from 'assert';
7
7
  import { format, inspect } from 'util';
@@ -6903,18 +6903,21 @@ function pathFromRoot(root, filename) {
6903
6903
  if (!filename.startsWith(root))
6904
6904
  return filename;
6905
6905
  const relativePath = relative(root, filename);
6906
- if (!relativePath.startsWith("/") && !relativePath.startsWith("."))
6907
- return `/${relativePath}`;
6908
- let index = 0;
6909
- for (const char of relativePath) {
6910
- if (char !== "." && char !== "/")
6911
- return relativePath.slice(index - 1);
6912
- index++;
6913
- }
6914
- return relativePath;
6906
+ const segments = relativePath.split("/");
6907
+ const startIndex = segments.findIndex((segment) => segment !== ".." && segment !== ".");
6908
+ return `/${segments.slice(startIndex).join("/")}`;
6915
6909
  }
6916
6910
  function toFilePath(id, root) {
6917
- let absolute = id.startsWith("/@fs/") ? id.slice(4) : id.startsWith(root) ? id : id.startsWith("/") ? resolve$1(root, id.slice(1)) : id;
6911
+ let absolute = (() => {
6912
+ if (id.startsWith("/@fs/"))
6913
+ return id.slice(4);
6914
+ if (!id.startsWith(root) && id.startsWith("/")) {
6915
+ const resolved = resolve$1(root, id.slice(1));
6916
+ if (existsSync(resolved.replace(/\?.*$/, "")))
6917
+ return resolved;
6918
+ }
6919
+ return id;
6920
+ })();
6918
6921
  if (absolute.startsWith("//"))
6919
6922
  absolute = absolute.slice(1);
6920
6923
  return isWindows && absolute.startsWith("/") ? slash(fileURLToPath$1(pathToFileURL(absolute.slice(1)).href)) : absolute;
@@ -56,6 +56,10 @@ async function main() {
56
56
  }
57
57
  }
58
58
  }
59
+ if (retries <= 0) {
60
+ await import('./cli.js');
61
+ return;
62
+ }
59
63
  const nodeArgs = [];
60
64
  const vitestArgs = [];
61
65
  for (let i = 0; i < args.length; i++) {
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { p as picocolors, n as normalize } from './chunk-utils-env.b1281522.js';
1
2
  import { EventEmitter } from 'events';
2
- import { p as picocolors } from './chunk-utils-env.b1281522.js';
3
- import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.efa824b9.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.d9033432.js';
4
4
  import 'tty';
5
5
  import 'url';
6
6
  import 'path';
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.cca09977.js';
8
8
  import 'local-pkg';
9
9
  import './chunk-env-node.700b7e95.js';
10
10
  import 'console';
11
- import './chunk-mock-date.9fe2b438.js';
11
+ import './chunk-mock-date.030959d3.js';
12
12
  import 'vite';
13
13
  import 'process';
14
14
  import 'fs';
@@ -16,17 +16,17 @@ import 'os';
16
16
  import 'util';
17
17
  import 'stream';
18
18
  import './vendor-_commonjsHelpers.addc3445.js';
19
- import './chunk-vite-node-client.e22799cd.js';
19
+ import './chunk-vite-node-client.3868b3ba.js';
20
20
  import 'module';
21
21
  import 'vm';
22
- import './chunk-vite-node-utils.835c8b2c.js';
22
+ import './chunk-vite-node-utils.2144000e.js';
23
23
  import 'assert';
24
24
  import 'debug';
25
25
  import 'perf_hooks';
26
26
  import 'worker_threads';
27
27
  import 'tinypool';
28
- import './chunk-utils-source-map.d9d36eb0.js';
29
- import './chunk-utils-timers.ab764c0c.js';
28
+ import './chunk-utils-timers.8fca243e.js';
29
+ import './chunk-utils-source-map.663e2952.js';
30
30
  import 'crypto';
31
31
  import './vendor-index.9c919048.js';
32
32
  import './vendor-index.1a291e86.js';
@@ -674,9 +674,15 @@ async function benchmark(cliFilters, options) {
674
674
  console.warn(picocolors.exports.yellow("Benchmarking is an experimental feature.\nBreaking changes might not follow semver, please pin Vitest's version when using it."));
675
675
  await start("benchmark", cliFilters, options);
676
676
  }
677
+ function normalizeOptions(argv) {
678
+ argv.root = argv.root && normalize(argv.root);
679
+ argv.config = argv.config && normalize(argv.config);
680
+ argv.dir = argv.dir && normalize(argv.dir);
681
+ return argv;
682
+ }
677
683
  async function start(mode, cliFilters, options) {
678
684
  try {
679
- if (await startVitest(mode, cliFilters, options) === false)
685
+ if (await startVitest(mode, cliFilters.map(normalize), normalizeOptions(options)) === false)
680
686
  process.exit();
681
687
  } catch (e) {
682
688
  process.exitCode = 1;
package/dist/config.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
6
- const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
6
+ const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*"];
7
7
  const defaultCoverageExcludes = [
8
8
  "coverage/**",
9
9
  "dist/**",
@@ -15,7 +15,7 @@ const defaultCoverageExcludes = [
15
15
  "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
16
16
  "**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
17
17
  "**/__tests__/**",
18
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}",
18
+ "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*",
19
19
  "**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
20
20
  ];
21
21
  const coverageConfigDefaults = {
@@ -61,8 +61,7 @@ const config = {
61
61
  watchExclude: ["**/node_modules/**", "**/dist/**"],
62
62
  forceRerunTriggers: [
63
63
  "**/package.json/**",
64
- "**/vitest.config.*/**",
65
- "**/vite.config.*/**"
64
+ "**/{vitest,vite}.config.*/**"
66
65
  ],
67
66
  update: false,
68
67
  reporters: [],
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UserConfig as UserConfig$2, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv } from 'vite';
3
- import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-732f9b14.js';
3
+ import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-58e8e951.js';
4
4
  import 'tinybench';
5
5
  import 'fs';
6
6
  import 'worker_threads';
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
2
- const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
2
+ const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*"];
3
3
  const defaultCoverageExcludes = [
4
4
  "coverage/**",
5
5
  "dist/**",
@@ -11,7 +11,7 @@ const defaultCoverageExcludes = [
11
11
  "**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
12
12
  "**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
13
13
  "**/__tests__/**",
14
- "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}",
14
+ "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.*",
15
15
  "**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
16
16
  ];
17
17
  const coverageConfigDefaults = {
@@ -57,8 +57,7 @@ const config = {
57
57
  watchExclude: ["**/node_modules/**", "**/dist/**"],
58
58
  forceRerunTriggers: [
59
59
  "**/package.json/**",
60
- "**/vitest.config.*/**",
61
- "**/vite.config.*/**"
60
+ "**/{vitest,vite}.config.*/**"
62
61
  ],
63
62
  update: false,
64
63
  reporters: [],
package/dist/entry.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { promises } from 'fs';
2
- import { g as getWorkerState, a as resetModules } from './chunk-mock-date.9fe2b438.js';
2
+ import { g as getWorkerState, a as resetModules } from './chunk-mock-date.030959d3.js';
3
3
  import { a as envs } from './chunk-env-node.700b7e95.js';
4
- import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.b043a88d.js';
4
+ import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.ab6b6274.js';
5
5
  import 'path';
6
6
  import './chunk-utils-env.b1281522.js';
7
7
  import 'tty';
@@ -10,16 +10,17 @@ import 'local-pkg';
10
10
  import 'console';
11
11
  import 'perf_hooks';
12
12
  import './chunk-integrations-coverage.cca09977.js';
13
- import './chunk-runtime-hooks.6963ff8f.js';
14
- import './chunk-runtime-chain.072b5677.js';
13
+ import './chunk-runtime-hooks.d748b085.js';
14
+ import './chunk-runtime-chain.37ec5d73.js';
15
15
  import 'util';
16
16
  import 'chai';
17
17
  import './vendor-_commonjsHelpers.addc3445.js';
18
- import './chunk-runtime-rpc.e583f5e7.js';
19
- import './chunk-utils-timers.ab764c0c.js';
20
- import './chunk-utils-source-map.d9d36eb0.js';
18
+ import './chunk-runtime-rpc.b418c0ab.js';
19
+ import './chunk-utils-timers.8fca243e.js';
20
+ import './chunk-utils-source-map.663e2952.js';
21
21
  import './spy.js';
22
22
  import 'tinyspy';
23
+ import './chunk-runtime-error.17751c39.js';
23
24
 
24
25
  function groupBy(collection, iteratee) {
25
26
  return collection.reduce((acc, item) => {
@@ -1,4 +1,4 @@
1
- import { a3 as Environment } from './global-732f9b14.js';
1
+ import { a3 as Environment } from './global-58e8e951.js';
2
2
  import 'vite';
3
3
  import 'tinybench';
4
4
  import 'fs';
@@ -205,6 +205,11 @@ interface CustomEventMap {
205
205
  'vite:beforePrune': PrunePayload
206
206
  'vite:beforeFullReload': FullReloadPayload
207
207
  'vite:error': ErrorPayload
208
+ 'vite:invalidate': InvalidatePayload
209
+ }
210
+
211
+ interface InvalidatePayload {
212
+ path: string
208
213
  }
209
214
 
210
215
  type InferCustomEventPayload<T extends string> =
@@ -1,5 +1,5 @@
1
1
  import { SpyImpl } from 'tinyspy';
2
- import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-732f9b14.js';
2
+ import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-58e8e951.js';
3
3
 
4
4
  interface MockResultReturn<T> {
5
5
  type: 'return';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-40e0cb97.js';
2
- export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-40e0cb97.js';
3
- import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-732f9b14.js';
4
- export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-732f9b14.js';
1
+ import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-220c1d70.js';
2
+ export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-220c1d70.js';
3
+ import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-58e8e951.js';
4
+ export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-58e8e951.js';
5
5
  import { TransformResult } from 'vite';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.072b5677.js';
2
- export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.6963ff8f.js';
1
+ export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.37ec5d73.js';
2
+ export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.d748b085.js';
3
3
  import * as chai from 'chai';
4
4
  export { chai };
5
5
  export { assert, should } from 'chai';
6
6
  import 'util';
7
- import './chunk-mock-date.9fe2b438.js';
7
+ import './chunk-mock-date.030959d3.js';
8
8
  import 'path';
9
9
  import './chunk-utils-env.b1281522.js';
10
10
  import 'tty';
11
11
  import 'url';
12
12
  import 'local-pkg';
13
13
  import './vendor-_commonjsHelpers.addc3445.js';
14
- import './chunk-runtime-rpc.e583f5e7.js';
15
- import './chunk-utils-timers.ab764c0c.js';
14
+ import './chunk-runtime-rpc.b418c0ab.js';
15
+ import './chunk-utils-timers.8fca243e.js';
16
16
  import 'fs';
17
- import './chunk-utils-source-map.d9d36eb0.js';
17
+ import './chunk-utils-source-map.663e2952.js';
18
18
  import './spy.js';
19
19
  import 'tinyspy';
package/dist/loader.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { pathToFileURL } from 'url';
2
2
  import { readFile } from 'fs/promises';
3
- import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.835c8b2c.js';
4
- import { g as getWorkerState } from './chunk-mock-date.9fe2b438.js';
3
+ import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.2144000e.js';
4
+ import { g as getWorkerState } from './chunk-mock-date.030959d3.js';
5
+ import 'fs';
5
6
  import './chunk-utils-env.b1281522.js';
6
7
  import 'tty';
7
8
  import 'path';
8
9
  import 'module';
9
- import 'fs';
10
10
  import 'assert';
11
11
  import 'util';
12
12
  import 'local-pkg';
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-732f9b14.js';
2
- export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-732f9b14.js';
1
+ import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-58e8e951.js';
2
+ export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-58e8e951.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import 'tinybench';
5
5
  import 'fs';
package/dist/node.js CHANGED
@@ -1,5 +1,5 @@
1
- export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.efa824b9.js';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.3eb1fcc0.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.d9033432.js';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.41b92ec9.js';
3
3
  import './chunk-utils-env.b1281522.js';
4
4
  import 'tty';
5
5
  import 'url';
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.cca09977.js';
8
8
  import 'local-pkg';
9
9
  import './chunk-env-node.700b7e95.js';
10
10
  import 'console';
11
- import './chunk-mock-date.9fe2b438.js';
11
+ import './chunk-mock-date.030959d3.js';
12
12
  import 'vite';
13
13
  import 'process';
14
14
  import 'fs';
@@ -17,17 +17,17 @@ import 'util';
17
17
  import 'stream';
18
18
  import 'events';
19
19
  import './vendor-_commonjsHelpers.addc3445.js';
20
- import './chunk-vite-node-client.e22799cd.js';
20
+ import './chunk-vite-node-client.3868b3ba.js';
21
21
  import 'module';
22
22
  import 'vm';
23
- import './chunk-vite-node-utils.835c8b2c.js';
23
+ import './chunk-vite-node-utils.2144000e.js';
24
24
  import 'assert';
25
25
  import 'debug';
26
26
  import 'perf_hooks';
27
27
  import 'worker_threads';
28
28
  import 'tinypool';
29
- import './chunk-utils-source-map.d9d36eb0.js';
30
- import './chunk-utils-timers.ab764c0c.js';
29
+ import './chunk-utils-timers.8fca243e.js';
30
+ import './chunk-utils-source-map.663e2952.js';
31
31
  import 'crypto';
32
32
  import './vendor-index.9c919048.js';
33
33
  import './vendor-index.1a291e86.js';
package/dist/suite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'util';
2
- import './chunk-mock-date.9fe2b438.js';
3
- export { b as bench, f as clearCollectorContext, p as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.072b5677.js';
2
+ import './chunk-mock-date.030959d3.js';
3
+ export { b as bench, f as clearCollectorContext, p as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.37ec5d73.js';
4
4
  import 'path';
5
5
  import './chunk-utils-env.b1281522.js';
6
6
  import 'tty';
@@ -8,9 +8,9 @@ import 'url';
8
8
  import 'local-pkg';
9
9
  import 'chai';
10
10
  import './vendor-_commonjsHelpers.addc3445.js';
11
- import './chunk-runtime-rpc.e583f5e7.js';
12
- import './chunk-utils-timers.ab764c0c.js';
11
+ import './chunk-runtime-rpc.b418c0ab.js';
12
+ import './chunk-utils-timers.8fca243e.js';
13
13
  import 'fs';
14
- import './chunk-utils-source-map.d9d36eb0.js';
14
+ import './chunk-utils-source-map.663e2952.js';
15
15
  import './spy.js';
16
16
  import 'tinyspy';
package/dist/worker.js CHANGED
@@ -1,22 +1,24 @@
1
1
  import { b as resolve, e as distDir } from './chunk-utils-env.b1281522.js';
2
- import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.e22799cd.js';
2
+ import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.3868b3ba.js';
3
3
  import { workerId } from 'tinypool';
4
- import { g as getWorkerState } from './chunk-mock-date.9fe2b438.js';
5
- import { e as executeInViteNode } from './chunk-runtime-mocker.3eb1fcc0.js';
6
- import { r as rpc } from './chunk-runtime-rpc.e583f5e7.js';
4
+ import { g as getWorkerState } from './chunk-mock-date.030959d3.js';
5
+ import { e as executeInViteNode } from './chunk-runtime-mocker.41b92ec9.js';
6
+ import { r as rpc } from './chunk-runtime-rpc.b418c0ab.js';
7
+ import { p as processError } from './chunk-runtime-error.17751c39.js';
7
8
  import 'tty';
8
9
  import 'url';
9
10
  import 'path';
10
11
  import 'module';
11
12
  import 'vm';
12
- import './chunk-vite-node-utils.835c8b2c.js';
13
+ import './chunk-vite-node-utils.2144000e.js';
13
14
  import 'fs';
14
15
  import 'assert';
15
16
  import 'util';
16
17
  import 'debug';
17
18
  import 'local-pkg';
18
19
  import 'vite';
19
- import './chunk-utils-timers.ab764c0c.js';
20
+ import './chunk-utils-timers.8fca243e.js';
21
+ import 'chai';
20
22
 
21
23
  let _viteNode;
22
24
  const moduleCache = new ModuleCacheMap();
@@ -33,7 +35,7 @@ async function startViteNode(ctx) {
33
35
  return processExit(code);
34
36
  };
35
37
  process.on("unhandledRejection", (err) => {
36
- rpc().onUnhandledRejection(err);
38
+ rpc().onUnhandledRejection(processError(err));
37
39
  });
38
40
  const { config } = ctx;
39
41
  const { run: run2 } = (await executeInViteNode({