vitest 0.28.2 → 0.28.4

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 (29) hide show
  1. package/dist/browser.d.ts +1 -1
  2. package/dist/browser.js +1 -1
  3. package/dist/{chunk-api-setup.52751a38.js → chunk-api-setup.ec61b167.js} +2 -2
  4. package/dist/{chunk-install-pkg.b62df426.js → chunk-install-pkg.13d8e7be.js} +4 -4
  5. package/dist/{chunk-integrations-globals.1a781ae7.js → chunk-integrations-globals.aacbac4d.js} +4 -4
  6. package/dist/{chunk-integrations-utils.d6d30a11.js → chunk-integrations-utils.dae69d89.js} +1 -1
  7. package/dist/{chunk-node-git.6e0efefe.js → chunk-node-git.d9ad64ab.js} +1 -1
  8. package/dist/{chunk-node-pkg.e7e5686f.js → chunk-node-pkg.94145502.js} +40 -25
  9. package/dist/{chunk-runtime-mocker.03017e8c.js → chunk-runtime-mocker.eb0c265c.js} +4 -5
  10. package/dist/{chunk-runtime-setup.28d2d580.js → chunk-runtime-setup.7dfc1a6a.js} +1 -1
  11. package/dist/{chunk-utils-base.977ae74f.js → chunk-utils-base.904102a8.js} +1 -4
  12. package/dist/{chunk-utils-import.9911c99d.js → chunk-utils-import.0402c9db.js} +2 -2
  13. package/dist/{chunk-utils-tasks.1b603032.js → chunk-utils-tasks.a9a8d8e1.js} +1 -1
  14. package/dist/cli-wrapper.js +1 -1
  15. package/dist/cli.js +4 -4
  16. package/dist/config.d.ts +1 -1
  17. package/dist/entry.js +5 -5
  18. package/dist/environments.d.ts +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +5 -5
  21. package/dist/node.d.ts +2 -2
  22. package/dist/node.js +5 -5
  23. package/dist/runners-chunk.js +2 -2
  24. package/dist/runners.d.ts +1 -1
  25. package/dist/runners.js +3 -3
  26. package/dist/{types-c800444e.d.ts → types-aac763a5.d.ts} +12 -1
  27. package/dist/{vendor-index.91e19d50.js → vendor-index.618ca5a1.js} +0 -0
  28. package/dist/worker.js +2 -3
  29. package/package.json +7 -7
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { startTests } from '@vitest/runner';
2
- import { a as ResolvedConfig } from './types-c800444e.js';
2
+ import { a as ResolvedConfig } from './types-aac763a5.js';
3
3
  export { s as setupSnapshotEnvironment } from './env-afee91f0.js';
4
4
  import '@vitest/expect';
5
5
  import 'vite';
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { startTests } from '@vitest/runner';
2
- export { s as setupCommonEnv } from './chunk-runtime-setup.28d2d580.js';
2
+ export { s as setupCommonEnv } from './chunk-runtime-setup.7dfc1a6a.js';
3
3
  export { s as setupSnapshotEnvironment } from './chunk-snapshot-env.6457638e.js';
4
4
  import '@vitest/utils';
5
5
  import './chunk-integrations-run-once.38756e30.js';
@@ -12,14 +12,14 @@ import require$$2$1 from 'http';
12
12
  import require$$7 from 'url';
13
13
  import { A as API_PATH } from './chunk-constants.797d3ebf.js';
14
14
  import './chunk-utils-global.442d1d33.js';
15
- import { a as parseStacktrace } from './chunk-utils-tasks.1b603032.js';
15
+ import { a as parseStacktrace } from './chunk-utils-tasks.a9a8d8e1.js';
16
16
  import 'node:url';
17
17
  import 'pathe';
18
18
  import './chunk-utils-env.860d90c2.js';
19
19
  import 'std-env';
20
20
  import '@vitest/runner/utils';
21
21
  import '@vitest/utils';
22
- import './chunk-utils-base.977ae74f.js';
22
+ import './chunk-utils-base.904102a8.js';
23
23
 
24
24
  async function getModuleGraph(ctx, id) {
25
25
  const graph = {};
@@ -2,8 +2,8 @@ import require$$0 from 'fs';
2
2
  import k from 'path';
3
3
  import require$$0$1 from 'util';
4
4
  import require$$0$3 from 'child_process';
5
- import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.91e19d50.js';
6
- import { o as onetime$1 } from './chunk-node-pkg.e7e5686f.js';
5
+ import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.618ca5a1.js';
6
+ import { o as onetime$1 } from './chunk-node-pkg.94145502.js';
7
7
  import require$$0$2 from 'os';
8
8
  import 'node:buffer';
9
9
  import 'node:path';
@@ -41,8 +41,8 @@ import 'node:worker_threads';
41
41
  import 'tinypool';
42
42
  import './vendor-index.783e7f3e.js';
43
43
  import 'perf_hooks';
44
- import './chunk-utils-base.977ae74f.js';
45
- import './chunk-utils-tasks.1b603032.js';
44
+ import './chunk-utils-base.904102a8.js';
45
+ import './chunk-utils-tasks.a9a8d8e1.js';
46
46
  import 'crypto';
47
47
  import 'vite-node/utils';
48
48
  import '@vitest/utils/diff';
@@ -1,11 +1,11 @@
1
1
  import { g as globalApis } from './chunk-constants.797d3ebf.js';
2
- import { i as index } from './chunk-integrations-utils.d6d30a11.js';
2
+ import { i as index } from './chunk-integrations-utils.dae69d89.js';
3
3
  import 'node:url';
4
4
  import 'pathe';
5
5
  import './chunk-utils-env.860d90c2.js';
6
6
  import 'std-env';
7
7
  import '@vitest/runner';
8
- import './chunk-utils-import.9911c99d.js';
8
+ import './chunk-utils-import.0402c9db.js';
9
9
  import '@vitest/runner/utils';
10
10
  import '@vitest/utils';
11
11
  import './chunk-utils-global.442d1d33.js';
@@ -14,8 +14,8 @@ import './vendor-_commonjsHelpers.addc3445.js';
14
14
  import '@vitest/expect';
15
15
  import './chunk-runtime-rpc.9c0386cc.js';
16
16
  import './chunk-snapshot-env.6457638e.js';
17
- import './chunk-utils-base.977ae74f.js';
18
- import './chunk-utils-tasks.1b603032.js';
17
+ import './chunk-utils-base.904102a8.js';
18
+ import './chunk-utils-tasks.a9a8d8e1.js';
19
19
  import 'util';
20
20
  import '@vitest/spy';
21
21
  import './chunk-integrations-run-once.38756e30.js';
@@ -1,5 +1,5 @@
1
1
  import { suite, test, describe, it, beforeAll, beforeEach, afterAll, afterEach, onTestFailed } from '@vitest/runner';
2
- import { b as bench, c as createExpect, g as globalExpect, v as vitest, a as vi } from './chunk-utils-import.9911c99d.js';
2
+ import { b as bench, c as createExpect, g as globalExpect, v as vitest, a as vi } from './chunk-utils-import.0402c9db.js';
3
3
  import { r as runOnce, i as isFirstRun } from './chunk-integrations-run-once.38756e30.js';
4
4
  import * as chai from 'chai';
5
5
  import { assert, should } from 'chai';
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'pathe';
2
- import { e as execa } from './vendor-index.91e19d50.js';
2
+ import { e as execa } from './vendor-index.618ca5a1.js';
3
3
  import 'node:buffer';
4
4
  import 'node:path';
5
5
  import 'node:child_process';
@@ -21,7 +21,7 @@ import { ViteNodeRunner } from 'vite-node/client';
21
21
  import { ViteNodeServer } from 'vite-node/server';
22
22
  import { A as AggregateErrorPonyfill, c as relativePath, a as getCallLastIndex, d as removeUndefinedValues, e as isWindows } from './chunk-utils-global.442d1d33.js';
23
23
  import { writeFile, rm } from 'node:fs/promises';
24
- import { e as execa, s as signalExit } from './vendor-index.91e19d50.js';
24
+ import { e as execa, s as signalExit } from './vendor-index.618ca5a1.js';
25
25
  import { SourceMapConsumer } from 'source-map';
26
26
  import K, { createRequire } from 'module';
27
27
  import { parse } from 'acorn';
@@ -32,8 +32,8 @@ import { cpus, hostname } from 'node:os';
32
32
  import { Tinypool } from 'tinypool';
33
33
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
34
34
  import { performance } from 'perf_hooks';
35
- import { s as slash$1, n as notNullish, t as toArray, a as noop$1, d as deepMerge, b as stdout } from './chunk-utils-base.977ae74f.js';
36
- import { g as getFullName, h as hasFailedSnapshot, a as parseStacktrace, p as positionToOffset, l as lineSplitRE } from './chunk-utils-tasks.1b603032.js';
35
+ import { s as slash$1, n as notNullish, t as toArray, a as noop$1, d as deepMerge, b as stdout } from './chunk-utils-base.904102a8.js';
36
+ import { g as getFullName, h as hasFailedSnapshot, a as parseStacktrace, p as positionToOffset, l as lineSplitRE } from './chunk-utils-tasks.a9a8d8e1.js';
37
37
  import { getSafeTimers, shuffle, stringify } from '@vitest/utils';
38
38
  import { createHash } from 'crypto';
39
39
  import { slash as slash$2, cleanUrl } from 'vite-node/utils';
@@ -58,7 +58,7 @@ function _mergeNamespaces(n, m) {
58
58
  return Object.freeze(n);
59
59
  }
60
60
 
61
- var version$1 = "0.28.2";
61
+ var version$1 = "0.28.4";
62
62
 
63
63
  async function ensurePackageInstalled(dependency, root) {
64
64
  if (isPackageExists(dependency, { paths: [root] }))
@@ -76,7 +76,7 @@ async function ensurePackageInstalled(dependency, root) {
76
76
  message: c.reset(`Do you want to install ${c.green(dependency)}?`)
77
77
  });
78
78
  if (install) {
79
- await (await import('./chunk-install-pkg.b62df426.js')).installPackage(dependency, { dev: true });
79
+ await (await import('./chunk-install-pkg.13d8e7be.js')).installPackage(dependency, { dev: true });
80
80
  process.stderr.write(c.yellow(`
81
81
  Package ${dependency} installed, re-run the command to start.
82
82
  `));
@@ -3541,7 +3541,7 @@ function createPool(ctx) {
3541
3541
  );
3542
3542
  const options = {
3543
3543
  filename: workerPath,
3544
- useAtomics: false,
3544
+ useAtomics: ctx.config.useAtomics ?? false,
3545
3545
  maxThreads,
3546
3546
  minThreads,
3547
3547
  execArgv: ctx.config.deps.registerNodeLoader ? [
@@ -3618,7 +3618,7 @@ function createPool(ctx) {
3618
3618
  var _a2;
3619
3619
  const nodeVersion = Number((_a2 = process.version.match(/v(\d+)\.(\d+)/)) == null ? void 0 : _a2[0].slice(1));
3620
3620
  if (nodeVersion >= 16.17)
3621
- await Promise.all(pool.threads.map((w) => w.terminate()));
3621
+ await pool.destroy();
3622
3622
  }
3623
3623
  };
3624
3624
  }
@@ -4010,17 +4010,21 @@ class BaseReporter {
4010
4010
  });
4011
4011
  const BADGE = c.inverse(c.bold(c.blue(" RERUN ")));
4012
4012
  const TRIGGER = trigger ? c.dim(` ${this.relative(trigger)}`) : "";
4013
+ const FILENAME_PATTERN = this.ctx.filenamePattern ? `${BADGE_PADDING} ${c.dim("Filename pattern: ")}${c.blue(this.ctx.filenamePattern)}
4014
+ ` : "";
4015
+ const TESTNAME_PATTERN = this.ctx.config.testNamePattern ? `${BADGE_PADDING} ${c.dim("Test name pattern: ")}${c.blue(String(this.ctx.config.testNamePattern))}
4016
+ ` : "";
4013
4017
  if (files.length > 1) {
4014
4018
  this.ctx.logger.clearFullScreen(`
4015
4019
  ${BADGE}${TRIGGER}
4016
- `);
4020
+ ${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
4017
4021
  this._lastRunCount = 0;
4018
4022
  } else if (files.length === 1) {
4019
4023
  const rerun = this._filesInWatchMode.get(files[0]) ?? 1;
4020
4024
  this._lastRunCount = rerun;
4021
4025
  this.ctx.logger.clearFullScreen(`
4022
4026
  ${BADGE}${TRIGGER} ${c.blue(`x${rerun}`)}
4023
- `);
4027
+ ${FILENAME_PATTERN}${TESTNAME_PATTERN}`);
4024
4028
  }
4025
4029
  this._timeStart = new Date();
4026
4030
  this.start = performance.now();
@@ -6394,11 +6398,11 @@ class VitestCache {
6394
6398
  return resolve(root, slash$1(dir || "node_modules/.vitest"));
6395
6399
  }
6396
6400
  static async clearCache(options) {
6397
- var _a;
6401
+ var _a, _b;
6398
6402
  const root = resolve(options.root || process.cwd());
6399
- const configPath = options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
6400
- const config = await loadConfigFromFile({ command: "serve", mode: "test" }, configPath);
6401
- const cache = (_a = config == null ? void 0 : config.config.test) == null ? void 0 : _a.cache;
6403
+ const configPath = options.config === false ? false : options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
6404
+ const config = configPath ? (_a = await loadConfigFromFile({ command: "serve", mode: "test" }, configPath)) == null ? void 0 : _a.config : void 0;
6405
+ const cache = (_b = config == null ? void 0 : config.test) == null ? void 0 : _b.cache;
6402
6406
  if (cache === false)
6403
6407
  throw new Error("Cache is disabled");
6404
6408
  const cachePath = VitestCache.resolveCacheDir(root, cache == null ? void 0 : cache.dir);
@@ -7165,7 +7169,7 @@ createLogUpdate(process$1.stdout);
7165
7169
 
7166
7170
  createLogUpdate(process$1.stderr);
7167
7171
 
7168
- var version = "0.28.2";
7172
+ var version = "0.28.4";
7169
7173
 
7170
7174
  async function printError(error, ctx, options = {}) {
7171
7175
  const { showCodeFrame = true, fullStack = false, type } = options;
@@ -7598,7 +7602,7 @@ class Vitest {
7598
7602
  }
7599
7603
  if (this.config.watch) {
7600
7604
  await this.report("onWatcherStart", files, [
7601
- ...sourceErrors,
7605
+ ...this.config.typecheck.ignoreSourceErrors ? [] : sourceErrors,
7602
7606
  ...this.state.getUnhandledErrors()
7603
7607
  ]);
7604
7608
  }
@@ -7668,7 +7672,7 @@ class Vitest {
7668
7672
  }
7669
7673
  async filterTestsBySource(tests) {
7670
7674
  if (this.config.changed && !this.config.related) {
7671
- const { VitestGit } = await import('./chunk-node-git.6e0efefe.js');
7675
+ const { VitestGit } = await import('./chunk-node-git.d9ad64ab.js');
7672
7676
  const vitestGit = new VitestGit(this.config.root);
7673
7677
  const related2 = await vitestGit.findChangedFiles({
7674
7678
  changedSince: this.config.changed
@@ -7732,24 +7736,29 @@ class Vitest {
7732
7736
  return await this.runningPromise;
7733
7737
  }
7734
7738
  async rerunFiles(files = this.state.getFilepaths(), trigger) {
7739
+ if (this.filenamePattern) {
7740
+ const filteredFiles = await this.globTestFiles([this.filenamePattern]);
7741
+ files = files.filter((file) => filteredFiles.includes(file));
7742
+ }
7735
7743
  if (this.coverageProvider && this.config.coverage.cleanOnRerun)
7736
7744
  await this.coverageProvider.clean();
7737
7745
  await this.report("onWatcherRerun", files, trigger);
7738
7746
  await this.runFiles(files);
7739
7747
  await this.reportCoverage(!trigger);
7740
7748
  if (!this.config.browser)
7741
- await this.report("onWatcherStart");
7749
+ await this.report("onWatcherStart", this.state.getFiles(files));
7742
7750
  }
7743
7751
  async changeNamePattern(pattern, files = this.state.getFilepaths(), trigger) {
7752
+ if (pattern === "")
7753
+ this.filenamePattern = void 0;
7744
7754
  this.config.testNamePattern = pattern ? new RegExp(pattern) : void 0;
7745
7755
  await this.rerunFiles(files, trigger);
7746
7756
  }
7747
7757
  async changeFilenamePattern(pattern) {
7758
+ this.filenamePattern = pattern;
7748
7759
  const files = this.state.getFilepaths();
7749
- if (!pattern)
7750
- return await this.rerunFiles(files, "reset filename pattern");
7751
- const filteredFiles = await this.globTestFiles([pattern]);
7752
- await this.rerunFiles(filteredFiles, "change filename pattern");
7760
+ const trigger = this.filenamePattern ? "change filename pattern" : "reset filename pattern";
7761
+ await this.rerunFiles(files, trigger);
7753
7762
  }
7754
7763
  async rerunFailed() {
7755
7764
  await this.rerunFiles(this.state.getFailedFilepaths(), "rerun failed");
@@ -7786,7 +7795,13 @@ class Vitest {
7786
7795
  return;
7787
7796
  this.isFirstRun = false;
7788
7797
  this.snapshot.clear();
7789
- const files = Array.from(this.changedTests);
7798
+ let files = Array.from(this.changedTests);
7799
+ if (this.filenamePattern) {
7800
+ const filteredFiles = await this.globTestFiles([this.filenamePattern]);
7801
+ files = files.filter((file) => filteredFiles.includes(file));
7802
+ if (files.length === 0)
7803
+ return;
7804
+ }
7790
7805
  this.changedTests.clear();
7791
7806
  if (this.coverageProvider && this.config.coverage.cleanOnRerun)
7792
7807
  await this.coverageProvider.clean();
@@ -7794,7 +7809,7 @@ class Vitest {
7794
7809
  await this.runFiles(files);
7795
7810
  await this.reportCoverage(false);
7796
7811
  if (!this.config.browser)
7797
- await this.report("onWatcherStart");
7812
+ await this.report("onWatcherStart", this.state.getFiles(files));
7798
7813
  }, WATCHER_DEBOUNCE);
7799
7814
  }
7800
7815
  registerWatcher() {
@@ -8388,7 +8403,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
8388
8403
  try {
8389
8404
  await ctx.setServer(options, server);
8390
8405
  if (options.api && options.watch)
8391
- (await import('./chunk-api-setup.52751a38.js')).setup(ctx);
8406
+ (await import('./chunk-api-setup.ec61b167.js')).setup(ctx);
8392
8407
  } catch (err) {
8393
8408
  ctx.logger.printError(err, true);
8394
8409
  process.exit(1);
@@ -8411,7 +8426,7 @@ async function createVitest(mode, options, viteOverrides = {}) {
8411
8426
  var _a;
8412
8427
  const ctx = new Vitest(mode);
8413
8428
  const root = resolve(options.root || process.cwd());
8414
- const configPath = options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
8429
+ const configPath = options.config === false ? false : options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
8415
8430
  const config = {
8416
8431
  logLevel: "error",
8417
8432
  configFile: configPath,
@@ -1,13 +1,12 @@
1
1
  import { ViteNodeRunner } from 'vite-node/client';
2
2
  import { isInternalRequest } from 'vite-node/utils';
3
- import { normalizePath } from 'vite';
3
+ import { resolve, isAbsolute, dirname, join, basename, extname, normalize } from 'pathe';
4
4
  import { i as isNodeBuiltin } from './vendor-index.bdee400f.js';
5
5
  import { g as getWorkerState, b as getCurrentEnvironment } from './chunk-utils-global.442d1d33.js';
6
6
  import { existsSync, readdirSync } from 'node:fs';
7
- import { resolve, isAbsolute, dirname, join, basename, extname } from 'pathe';
8
- import { getColors } from '@vitest/utils';
7
+ import { getColors, getType } from '@vitest/utils';
8
+ import { g as getAllMockableProperties } from './chunk-utils-base.904102a8.js';
9
9
  import { d as distDir } from './chunk-constants.797d3ebf.js';
10
- import { g as getType, c as getAllMockableProperties } from './chunk-utils-base.977ae74f.js';
11
10
 
12
11
  class RefTracker {
13
12
  constructor() {
@@ -339,7 +338,7 @@ class VitestRunner extends ViteNodeRunner {
339
338
  }
340
339
  prepareContext(context) {
341
340
  const workerState = getWorkerState();
342
- if (workerState.filepath && normalizePath(workerState.filepath) === normalizePath(context.__filename)) {
341
+ if (workerState.filepath && normalize(workerState.filepath) === normalize(context.__filename)) {
343
342
  Object.defineProperty(context.__vite_ssr_import_meta__, "vitest", { get: () => globalThis.__vitest_index__ });
344
343
  }
345
344
  return context;
@@ -10,7 +10,7 @@ async function setupCommonEnv(config) {
10
10
  globalSetup = true;
11
11
  setSafeTimers();
12
12
  if (config.globals)
13
- (await import('./chunk-integrations-globals.1a781ae7.js')).registerApiGlobally();
13
+ (await import('./chunk-integrations-globals.aacbac4d.js')).registerApiGlobally();
14
14
  }
15
15
  function setupDefines(defines) {
16
16
  for (const key in defines)
@@ -33,9 +33,6 @@ function slash(str) {
33
33
  }
34
34
  const noop = () => {
35
35
  };
36
- function getType(value) {
37
- return Object.prototype.toString.apply(value).slice(8, -1);
38
- }
39
36
  function toArray(array) {
40
37
  if (array === null || array === void 0)
41
38
  array = [];
@@ -74,4 +71,4 @@ function stdout() {
74
71
  return console._stdout || process.stdout;
75
72
  }
76
73
 
77
- export { noop as a, stdout as b, getAllMockableProperties as c, deepMerge as d, getType as g, isObject as i, notNullish as n, slash as s, toArray as t };
74
+ export { noop as a, stdout as b, deepMerge as d, getAllMockableProperties as g, isObject as i, notNullish as n, slash as s, toArray as t };
@@ -9,8 +9,8 @@ import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, J
9
9
  import { r as rpc } from './chunk-runtime-rpc.9c0386cc.js';
10
10
  import { join, dirname } from 'pathe';
11
11
  import { g as getSnapshotEnironment } from './chunk-snapshot-env.6457638e.js';
12
- import { i as isObject, s as slash } from './chunk-utils-base.977ae74f.js';
13
- import { p as positionToOffset, o as offsetToLineNumber, l as lineSplitRE, a as parseStacktrace, g as getFullName, b as parseSingleStack } from './chunk-utils-tasks.1b603032.js';
12
+ import { i as isObject, s as slash } from './chunk-utils-base.904102a8.js';
13
+ import { p as positionToOffset, o as offsetToLineNumber, l as lineSplitRE, a as parseStacktrace, g as getFullName, b as parseSingleStack } from './chunk-utils-tasks.a9a8d8e1.js';
14
14
  import require$$0 from 'util';
15
15
  import { spyOn, fn, isMockFunction, spies } from '@vitest/spy';
16
16
 
@@ -1,6 +1,6 @@
1
1
  import { getNames, getTests } from '@vitest/runner/utils';
2
2
  import { resolve } from 'pathe';
3
- import { n as notNullish } from './chunk-utils-base.977ae74f.js';
3
+ import { n as notNullish } from './chunk-utils-base.904102a8.js';
4
4
 
5
5
  function hasFailedSnapshot(suite) {
6
6
  return getTests(suite).some((s) => {
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'url';
2
2
  import c from 'picocolors';
3
- import { e as execa } from './vendor-index.91e19d50.js';
3
+ import { e as execa } from './vendor-index.618ca5a1.js';
4
4
  import { E as EXIT_CODE_RESTART } from './chunk-constants.797d3ebf.js';
5
5
  import 'node:buffer';
6
6
  import 'node:path';
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { normalize } from 'pathe';
2
2
  import cac from 'cac';
3
3
  import c from 'picocolors';
4
- import { v as version, s as startVitest, d as divider } from './chunk-node-pkg.e7e5686f.js';
4
+ import { v as version, s as startVitest, d as divider } from './chunk-node-pkg.94145502.js';
5
5
  import './chunk-constants.797d3ebf.js';
6
6
  import 'node:url';
7
7
  import './chunk-utils-env.860d90c2.js';
@@ -27,7 +27,7 @@ import './chunk-utils-global.442d1d33.js';
27
27
  import '@vitest/runner/utils';
28
28
  import '@vitest/utils';
29
29
  import 'node:fs/promises';
30
- import './vendor-index.91e19d50.js';
30
+ import './vendor-index.618ca5a1.js';
31
31
  import 'node:buffer';
32
32
  import 'node:child_process';
33
33
  import 'child_process';
@@ -42,8 +42,8 @@ import 'node:worker_threads';
42
42
  import 'tinypool';
43
43
  import './vendor-index.783e7f3e.js';
44
44
  import 'perf_hooks';
45
- import './chunk-utils-base.977ae74f.js';
46
- import './chunk-utils-tasks.1b603032.js';
45
+ import './chunk-utils-base.904102a8.js';
46
+ import './chunk-utils-tasks.a9a8d8e1.js';
47
47
  import 'crypto';
48
48
  import 'vite-node/utils';
49
49
  import '@vitest/utils/diff';
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 { a1 as ResolvedCoverageOptions, U as UserConfig$1, a4 as CoverageC8Options, _ as CoverageProviderModule, a2 as BaseCoverageOptions, a3 as CoverageIstanbulOptions, $ as CoverageReporter, F as FakeTimerInstallOpts } from './types-c800444e.js';
3
+ import { a1 as ResolvedCoverageOptions, U as UserConfig$1, a4 as CoverageC8Options, _ as CoverageProviderModule, a2 as BaseCoverageOptions, a3 as CoverageIstanbulOptions, $ as CoverageReporter, F as FakeTimerInstallOpts } from './types-aac763a5.js';
4
4
  import '@vitest/expect';
5
5
  import '@vitest/runner/types';
6
6
  import '@vitest/runner';
package/dist/entry.js CHANGED
@@ -2,16 +2,16 @@ import { promises, existsSync } from 'node:fs';
2
2
  import { m as micromatch_1, t as takeCoverageInsideWorker } from './chunk-integrations-coverage.48e6286b.js';
3
3
  import { startTests } from '@vitest/runner';
4
4
  import { g as getWorkerState, r as resetModules } from './chunk-utils-global.442d1d33.js';
5
- import { R as RealDate, g as globalExpect, a as vi } from './chunk-utils-import.9911c99d.js';
5
+ import { R as RealDate, g as globalExpect, a as vi } from './chunk-utils-import.0402c9db.js';
6
6
  import { e as environments, a as envs } from './chunk-env-node.ffd1183b.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import c from 'picocolors';
9
9
  import { installSourcemapsSupport } from 'vite-node/source-map';
10
10
  import { setColors, getSafeTimers } from '@vitest/utils';
11
- import { i as index } from './chunk-integrations-utils.d6d30a11.js';
11
+ import { i as index } from './chunk-integrations-utils.dae69d89.js';
12
12
  import { s as setupSnapshotEnvironment } from './chunk-snapshot-env.6457638e.js';
13
13
  import { r as rpc } from './chunk-runtime-rpc.9c0386cc.js';
14
- import { s as setupCommonEnv } from './chunk-runtime-setup.28d2d580.js';
14
+ import { s as setupCommonEnv } from './chunk-runtime-setup.7dfc1a6a.js';
15
15
  import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './runners-chunk.js';
16
16
  import 'local-pkg';
17
17
  import 'util';
@@ -23,8 +23,8 @@ import '@vitest/runner/utils';
23
23
  import 'chai';
24
24
  import './vendor-_commonjsHelpers.addc3445.js';
25
25
  import '@vitest/expect';
26
- import './chunk-utils-base.977ae74f.js';
27
- import './chunk-utils-tasks.1b603032.js';
26
+ import './chunk-utils-base.904102a8.js';
27
+ import './chunk-utils-tasks.a9a8d8e1.js';
28
28
  import '@vitest/spy';
29
29
  import 'node:console';
30
30
  import './chunk-integrations-run-once.38756e30.js';
@@ -1,4 +1,4 @@
1
- import { P as Environment } from './types-c800444e.js';
1
+ import { P as Environment } from './types-aac763a5.js';
2
2
  import '@vitest/expect';
3
3
  import 'vite';
4
4
  import '@vitest/runner/types';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Test } from '@vitest/runner';
2
2
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
3
- import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, a as ResolvedConfig, b as ModuleGraphData, S as SnapshotResult, c as Reporter } from './types-c800444e.js';
4
- export { u as AfterSuiteRunMeta, A as ApiConfig, z as ArgumentsType, y as Arrayable, x as Awaitable, a2 as BaseCoverageOptions, a8 as BenchFunction, a6 as Benchmark, B as BenchmarkAPI, a7 as BenchmarkResult, a5 as BenchmarkUserOptions, h as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, e as CollectLines, K as Constructable, g as Context, a4 as CoverageC8Options, a3 as CoverageIstanbulOptions, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule, $ as CoverageReporter, G as DeepMerge, P as Environment, E as EnvironmentOptions, O as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, D as MergeInsertions, L as ModuleCache, b as ModuleGraphData, H as MutableArray, N as Nullable, X as OnServerRestartHandler, d as RawErrsMap, Z as ReportContext, c as Reporter, t as ResolveIdFunction, a as ResolvedConfig, a1 as ResolvedCoverageOptions, f as RootAndTarget, R as RuntimeConfig, j as SequenceHooks, n as SnapshotData, q as SnapshotMatchOptions, S as SnapshotResult, p as SnapshotStateOptions, s as SnapshotSummary, o as SnapshotUpdateState, T as TscErrorInfo, l as TypecheckConfig, r as UncheckedSnapshot, U as UserConfig, Q as UserConsoleLog, m as Vitest, V as VitestEnvironment, k as VitestRunMode, W as WorkerContext, w as WorkerGlobalState, v as WorkerRPC } from './types-c800444e.js';
3
+ import { B as BenchmarkAPI, F as FakeTimerInstallOpts, M as MockFactoryWithHelper, R as RuntimeConfig, a as ResolvedConfig, b as ModuleGraphData, S as SnapshotResult, c as Reporter } from './types-aac763a5.js';
4
+ export { u as AfterSuiteRunMeta, A as ApiConfig, z as ArgumentsType, y as Arrayable, x as Awaitable, a2 as BaseCoverageOptions, a8 as BenchFunction, a6 as Benchmark, B as BenchmarkAPI, a7 as BenchmarkResult, a5 as BenchmarkUserOptions, h as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, e as CollectLines, K as Constructable, g as Context, a4 as CoverageC8Options, a3 as CoverageIstanbulOptions, a0 as CoverageOptions, Y as CoverageProvider, _ as CoverageProviderModule, $ as CoverageReporter, G as DeepMerge, P as Environment, E as EnvironmentOptions, O as EnvironmentReturn, I as InlineConfig, J as JSDOMOptions, D as MergeInsertions, L as ModuleCache, b as ModuleGraphData, H as MutableArray, N as Nullable, X as OnServerRestartHandler, d as RawErrsMap, Z as ReportContext, c as Reporter, t as ResolveIdFunction, a as ResolvedConfig, a1 as ResolvedCoverageOptions, f as RootAndTarget, R as RuntimeConfig, j as SequenceHooks, n as SnapshotData, q as SnapshotMatchOptions, S as SnapshotResult, p as SnapshotStateOptions, s as SnapshotSummary, o as SnapshotUpdateState, T as TscErrorInfo, l as TypecheckConfig, r as UncheckedSnapshot, U as UserConfig, Q as UserConsoleLog, m as Vitest, V as VitestEnvironment, k as VitestRunMode, W as WorkerContext, w as WorkerGlobalState, v as WorkerRPC } from './types-aac763a5.js';
5
5
  import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, EnhancedSpy } from '@vitest/spy';
6
6
  export { EnhancedSpy, Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject, SpyInstance } from '@vitest/spy';
7
7
  export { S as SnapshotEnvironment } from './env-afee91f0.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
2
- export { b as bench, c as createExpect, g as expect, a as vi, v as vitest } from './chunk-utils-import.9911c99d.js';
2
+ export { b as bench, c as createExpect, g as expect, a as vi, v as vitest } from './chunk-utils-import.0402c9db.js';
3
3
  export { i as isFirstRun, r as runOnce } from './chunk-integrations-run-once.38756e30.js';
4
- import { d as dist } from './chunk-integrations-utils.d6d30a11.js';
5
- export { b as assertType, g as getRunningMode, a as isWatchMode } from './chunk-integrations-utils.d6d30a11.js';
4
+ import { d as dist } from './chunk-integrations-utils.dae69d89.js';
5
+ export { b as assertType, g as getRunningMode, a as isWatchMode } from './chunk-integrations-utils.dae69d89.js';
6
6
  import * as chai from 'chai';
7
7
  export { chai };
8
8
  export { assert, should } from 'chai';
@@ -16,8 +16,8 @@ import './vendor-_commonjsHelpers.addc3445.js';
16
16
  import '@vitest/expect';
17
17
  import './chunk-runtime-rpc.9c0386cc.js';
18
18
  import './chunk-snapshot-env.6457638e.js';
19
- import './chunk-utils-base.977ae74f.js';
20
- import './chunk-utils-tasks.1b603032.js';
19
+ import './chunk-utils-base.904102a8.js';
20
+ import './chunk-utils-tasks.a9a8d8e1.js';
21
21
  import 'util';
22
22
  import '@vitest/spy';
23
23
 
package/dist/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { k as VitestRunMode, U as UserConfig, m as Vitest, a9 as MockFactory, aa as MockMap, ab as TestSequencer } from './types-c800444e.js';
2
- export { ab as TestSequencer, ad as TestSequencerConstructor, m as Vitest, ac as startVitest } from './types-c800444e.js';
1
+ import { k as VitestRunMode, U as UserConfig, m as Vitest, a9 as MockFactory, aa as MockMap, ab as TestSequencer } from './types-aac763a5.js';
2
+ export { ab as TestSequencer, ad as TestSequencerConstructor, m as Vitest, ac as startVitest } from './types-aac763a5.js';
3
3
  import { UserConfig as UserConfig$1, Plugin } from 'vite';
4
4
  import { ViteNodeRunner } from 'vite-node/client';
5
5
  import { ViteNodeRunnerOptions } from 'vite-node';
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-node-pkg.e7e5686f.js';
2
- export { V as VitestRunner } from './chunk-runtime-mocker.03017e8c.js';
1
+ export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-node-pkg.94145502.js';
2
+ export { V as VitestRunner } from './chunk-runtime-mocker.eb0c265c.js';
3
3
  import 'pathe';
4
4
  import './chunk-constants.797d3ebf.js';
5
5
  import 'node:url';
@@ -27,7 +27,7 @@ import './chunk-utils-global.442d1d33.js';
27
27
  import '@vitest/runner/utils';
28
28
  import '@vitest/utils';
29
29
  import 'node:fs/promises';
30
- import './vendor-index.91e19d50.js';
30
+ import './vendor-index.618ca5a1.js';
31
31
  import 'node:buffer';
32
32
  import 'node:child_process';
33
33
  import 'child_process';
@@ -42,8 +42,8 @@ import 'node:worker_threads';
42
42
  import 'tinypool';
43
43
  import './vendor-index.783e7f3e.js';
44
44
  import 'perf_hooks';
45
- import './chunk-utils-base.977ae74f.js';
46
- import './chunk-utils-tasks.1b603032.js';
45
+ import './chunk-utils-base.904102a8.js';
46
+ import './chunk-utils-tasks.a9a8d8e1.js';
47
47
  import 'crypto';
48
48
  import 'vite-node/utils';
49
49
  import '@vitest/utils/diff';
@@ -1,7 +1,7 @@
1
1
  import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
2
- import { d as getSnapshotClient, c as createExpect, a as vi, e as getBenchOptions, f as getBenchFn } from './chunk-utils-import.9911c99d.js';
2
+ import { d as getSnapshotClient, c as createExpect, a as vi, e as getBenchOptions, f as getBenchFn } from './chunk-utils-import.0402c9db.js';
3
3
  import { g as getWorkerState } from './chunk-utils-global.442d1d33.js';
4
- import { g as getFullName } from './chunk-utils-tasks.1b603032.js';
4
+ import { g as getFullName } from './chunk-utils-tasks.a9a8d8e1.js';
5
5
  import { updateTask } from '@vitest/runner';
6
6
  import { createDefer, getSafeTimers } from '@vitest/utils';
7
7
 
package/dist/runners.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VitestRunner, VitestRunnerImportSource, Suite, Test, TestContext } from '@vitest/runner';
2
- import { a as ResolvedConfig } from './types-c800444e.js';
2
+ import { a as ResolvedConfig } from './types-aac763a5.js';
3
3
  import '@vitest/expect';
4
4
  import 'vite';
5
5
  import '@vitest/runner/types';
package/dist/runners.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { N as NodeBenchmarkRunner, V as VitestTestRunner } from './runners-chunk.js';
2
2
  import '@vitest/expect';
3
- import './chunk-utils-import.9911c99d.js';
3
+ import './chunk-utils-import.0402c9db.js';
4
4
  import '@vitest/runner';
5
5
  import '@vitest/runner/utils';
6
6
  import '@vitest/utils';
@@ -12,7 +12,7 @@ import 'chai';
12
12
  import './vendor-_commonjsHelpers.addc3445.js';
13
13
  import './chunk-runtime-rpc.9c0386cc.js';
14
14
  import './chunk-snapshot-env.6457638e.js';
15
- import './chunk-utils-base.977ae74f.js';
16
- import './chunk-utils-tasks.1b603032.js';
15
+ import './chunk-utils-base.904102a8.js';
16
+ import './chunk-utils-tasks.a9a8d8e1.js';
17
17
  import 'util';
18
18
  import '@vitest/spy';
@@ -380,6 +380,7 @@ declare class Vitest {
380
380
  vitenode: ViteNodeServer;
381
381
  invalidates: Set<string>;
382
382
  changedTests: Set<string>;
383
+ filenamePattern?: string;
383
384
  runningPromise?: Promise<void>;
384
385
  closingPromise?: Promise<void>;
385
386
  isFirstRun: boolean;
@@ -1482,6 +1483,14 @@ interface InlineConfig {
1482
1483
  * @default available CPUs
1483
1484
  */
1484
1485
  minThreads?: number;
1486
+ /**
1487
+ * Use Atomics to synchronize threads
1488
+ *
1489
+ * This can improve performance in some cases, but might cause segfault in older Node versions.
1490
+ *
1491
+ * @default false
1492
+ */
1493
+ useAtomics?: boolean;
1485
1494
  /**
1486
1495
  * Default timeout of a test in milliseconds
1487
1496
  *
@@ -1762,8 +1771,10 @@ interface UserConfig extends InlineConfig {
1762
1771
  * Path to the config file.
1763
1772
  *
1764
1773
  * Default resolving to `vitest.config.*`, `vite.config.*`
1774
+ *
1775
+ * Setting to `false` will disable config resolving.
1765
1776
  */
1766
- config?: string | undefined;
1777
+ config?: string | false | undefined;
1767
1778
  /**
1768
1779
  * Use happy-dom
1769
1780
  */
package/dist/worker.js CHANGED
@@ -6,13 +6,12 @@ import { ModuleCacheMap } from 'vite-node/client';
6
6
  import { isPrimitive } from 'vite-node/utils';
7
7
  import { d as distDir } from './chunk-constants.797d3ebf.js';
8
8
  import { g as getWorkerState } from './chunk-utils-global.442d1d33.js';
9
- import { e as executeInViteNode } from './chunk-runtime-mocker.03017e8c.js';
9
+ import { e as executeInViteNode } from './chunk-runtime-mocker.eb0c265c.js';
10
10
  import { r as rpc } from './chunk-runtime-rpc.9c0386cc.js';
11
11
  import 'node:url';
12
12
  import './chunk-utils-env.860d90c2.js';
13
13
  import 'std-env';
14
14
  import '@vitest/utils';
15
- import 'vite';
16
15
  import './vendor-index.bdee400f.js';
17
16
  import 'acorn';
18
17
  import 'node:module';
@@ -22,7 +21,7 @@ import 'node:process';
22
21
  import 'node:path';
23
22
  import 'node:v8';
24
23
  import 'node:util';
25
- import './chunk-utils-base.977ae74f.js';
24
+ import './chunk-utils-base.904102a8.js';
26
25
 
27
26
  let _viteNode;
28
27
  const moduleCache = new ModuleCacheMap();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitest",
3
3
  "type": "module",
4
- "version": "0.28.2",
4
+ "version": "0.28.4",
5
5
  "description": "A blazing fast unit test framework powered by Vite",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -124,15 +124,15 @@
124
124
  "std-env": "^3.3.1",
125
125
  "strip-literal": "^1.0.0",
126
126
  "tinybench": "^2.3.1",
127
- "tinypool": "^0.3.0",
127
+ "tinypool": "^0.3.1",
128
128
  "tinyspy": "^1.0.2",
129
129
  "vite": "^3.0.0 || ^4.0.0",
130
130
  "why-is-node-running": "^2.2.2",
131
- "@vitest/runner": "0.28.2",
132
- "@vitest/spy": "0.28.2",
133
- "@vitest/expect": "0.28.2",
134
- "@vitest/utils": "0.28.2",
135
- "vite-node": "0.28.2"
131
+ "vite-node": "0.28.4",
132
+ "@vitest/utils": "0.28.4",
133
+ "@vitest/expect": "0.28.4",
134
+ "@vitest/runner": "0.28.4",
135
+ "@vitest/spy": "0.28.4"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@antfu/install-pkg": "^0.1.1",