vitest 1.0.0-beta.2 → 1.0.0-beta.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 (53) hide show
  1. package/LICENSE.md +17 -29
  2. package/dist/browser.d.ts +1 -2
  3. package/dist/browser.js +3 -3
  4. package/dist/child.js +13 -7
  5. package/dist/{chunk-api-setup.5d9a93c7.js → chunk-api-setup.6d19ab38.js} +6 -4
  6. package/dist/{chunk-install-pkg.43d58972.js → chunk-install-pkg.e1d6323e.js} +12 -14
  7. package/dist/{chunk-integrations-globals.9df12d91.js → chunk-integrations-globals.2b099e04.js} +6 -6
  8. package/dist/{chunk-node-git.2f1df48f.js → chunk-node-git.6c12e560.js} +1 -1
  9. package/dist/cli-wrapper.js +1 -1
  10. package/dist/cli.js +16 -20
  11. package/dist/config.cjs +1 -0
  12. package/dist/config.d.ts +2 -3
  13. package/dist/config.js +1 -0
  14. package/dist/coverage.d.ts +1 -2
  15. package/dist/coverage.js +2 -2
  16. package/dist/entry-vm.js +8 -8
  17. package/dist/entry.js +8 -8
  18. package/dist/environments.d.ts +1 -2
  19. package/dist/environments.js +1 -13
  20. package/dist/execute.d.ts +2 -3
  21. package/dist/execute.js +1 -2
  22. package/dist/index.d.ts +232 -59
  23. package/dist/index.js +7 -7
  24. package/dist/node.d.ts +10 -4
  25. package/dist/node.js +16 -18
  26. package/dist/{reporters-d10f25e1.d.ts → reporters-50c2bd49.d.ts} +100 -35
  27. package/dist/reporters.d.ts +1 -2
  28. package/dist/reporters.js +3 -3
  29. package/dist/runners.d.ts +3 -3
  30. package/dist/runners.js +37 -41
  31. package/dist/{suite-919dd548.d.ts → suite-ad69b7cd.d.ts} +1 -1
  32. package/dist/suite.d.ts +2 -3
  33. package/dist/suite.js +3 -3
  34. package/dist/{vendor-benchmark.44931cfa.js → vendor-benchmark.b6befc50.js} +1 -1
  35. package/dist/{vendor-environments.094f240c.js → vendor-environments.dcc4a34e.js} +4 -37
  36. package/dist/{vendor-execute.07d1a420.js → vendor-execute.157302d6.js} +3 -3
  37. package/dist/vendor-global.c3664e75.js +14 -0
  38. package/dist/{vendor-index.29282562.js → vendor-index.2b92937b.js} +1 -1
  39. package/dist/{vendor-index.d36f5516.js → vendor-index.57925a34.js} +8 -3
  40. package/dist/{vendor-index.68ecee35.js → vendor-index.72df742e.js} +11 -4
  41. package/dist/{vendor-index.e006069f.js → vendor-index.8efe7746.js} +371 -371
  42. package/dist/{vendor-index.0b5b3600.js → vendor-loader.9c966f23.js} +36 -9
  43. package/dist/{vendor-node.e5a35bfe.js → vendor-node.65461b16.js} +2660 -2021
  44. package/dist/{vendor-reporters.2953082e.js → vendor-reporters.d24d80a4.js} +42 -25
  45. package/dist/{vendor-rpc.cbd8e972.js → vendor-rpc.171f65fb.js} +1 -1
  46. package/dist/{vendor-run-once.3e5ef7d7.js → vendor-run-once.fb836747.js} +1 -1
  47. package/dist/{vendor-vi.d30b47ae.js → vendor-vi.3baa7c4a.js} +32 -35
  48. package/dist/vm.js +14 -8
  49. package/dist/worker.js +14 -8
  50. package/package.json +12 -28
  51. package/dist/loader.js +0 -100
  52. package/dist/vendor-global.97e4527c.js +0 -9
  53. package/dist/vendor-index.98139333.js +0 -129
package/LICENSE.md CHANGED
@@ -433,35 +433,6 @@ Repository: https://github.com/mathiasbynens/emoji-regex.git
433
433
 
434
434
  ---------------------------------------
435
435
 
436
- ## event-target-polyfill
437
- License: MIT
438
- By: Ben Lesh
439
- Repository: git+https://github.com/benlesh/event-target-polyfill.git
440
-
441
- > MIT License
442
- >
443
- > Copyright (c) 2020 Ben Lesh
444
- >
445
- > Permission is hereby granted, free of charge, to any person obtaining a copy
446
- > of this software and associated documentation files (the "Software"), to deal
447
- > in the Software without restriction, including without limitation the rights
448
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
449
- > copies of the Software, and to permit persons to whom the Software is
450
- > furnished to do so, subject to the following conditions:
451
- >
452
- > The above copyright notice and this permission notice shall be included in all
453
- > copies or substantial portions of the Software.
454
- >
455
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
456
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
457
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
458
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
459
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
460
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
461
- > SOFTWARE.
462
-
463
- ---------------------------------------
464
-
465
436
  ## execa
466
437
  License: MIT
467
438
  By: Sindre Sorhus
@@ -806,6 +777,23 @@ Repository: git+https://github.com/WebReflection/flatted.git
806
777
 
807
778
  ---------------------------------------
808
779
 
780
+ ## get-east-asian-width
781
+ License: MIT
782
+ By: Sindre Sorhus
783
+ Repository: sindresorhus/get-east-asian-width
784
+
785
+ > MIT License
786
+ >
787
+ > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
788
+ >
789
+ > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
790
+ >
791
+ > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
792
+ >
793
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
794
+
795
+ ---------------------------------------
796
+
809
797
  ## get-stream
810
798
  License: MIT
811
799
  By: Sindre Sorhus
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { processError, startTests } from '@vitest/runner';
2
- import { R as ResolvedConfig, e as CoverageOptions, f as CoverageProvider, g as CoverageProviderModule } from './reporters-d10f25e1.js';
2
+ import { R as ResolvedConfig, b as CoverageOptions, c as CoverageProvider, d as CoverageProviderModule } from './reporters-50c2bd49.js';
3
3
  import { VitestExecutor } from './execute.js';
4
4
  import 'vite';
5
5
  import 'vite-node';
@@ -12,7 +12,6 @@ import 'vite-node/client';
12
12
  import '@vitest/snapshot/manager';
13
13
  import 'vite-node/server';
14
14
  import 'node:worker_threads';
15
- import 'rollup';
16
15
  import 'node:fs';
17
16
  import 'chai';
18
17
  import 'node:vm';
package/dist/browser.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { processError, startTests } from '@vitest/runner';
2
2
  import { setSafeTimers } from '@vitest/utils';
3
- import { a as resetRunOnceCounter } from './vendor-run-once.3e5ef7d7.js';
3
+ import { a as resetRunOnceCounter } from './vendor-run-once.fb836747.js';
4
4
  export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor-coverage.78040316.js';
5
- import './vendor-global.97e4527c.js';
5
+ import './vendor-global.c3664e75.js';
6
6
 
7
7
  let globalSetup = false;
8
8
  async function setupCommonEnv(config) {
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
13
13
  globalSetup = true;
14
14
  setSafeTimers();
15
15
  if (config.globals)
16
- (await import('./chunk-integrations-globals.9df12d91.js')).registerApiGlobally();
16
+ (await import('./chunk-integrations-globals.2b099e04.js')).registerApiGlobally();
17
17
  }
18
18
  function setupDefines(defines) {
19
19
  for (const key in defines)
package/dist/child.js CHANGED
@@ -3,12 +3,11 @@ import v8 from 'node:v8';
3
3
  import { c as createBirpc } from './vendor-index.1ca68bd5.js';
4
4
  import { parseRegexp } from '@vitest/utils';
5
5
  import { workerId } from 'tinypool';
6
- import { l as loadEnvironment } from './vendor-environments.094f240c.js';
7
- import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.07d1a420.js';
8
- import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
6
+ import { l as loadEnvironment } from './vendor-loader.9c966f23.js';
7
+ import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.157302d6.js';
8
+ import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.171f65fb.js';
9
9
  import { s as setupInspect } from './vendor-inspector.209edf5a.js';
10
10
  import 'pathe';
11
- import './vendor-index.0b5b3600.js';
12
11
  import 'acorn';
13
12
  import 'node:module';
14
13
  import 'node:fs';
@@ -18,18 +17,19 @@ import 'node:process';
18
17
  import 'node:path';
19
18
  import 'node:util';
20
19
  import 'vite-node/client';
20
+ import './vendor-environments.dcc4a34e.js';
21
21
  import 'node:console';
22
22
  import 'local-pkg';
23
23
  import 'node:vm';
24
24
  import 'vite-node/utils';
25
25
  import '@vitest/utils/error';
26
26
  import './vendor-paths.84fc7a99.js';
27
- import './vendor-global.97e4527c.js';
28
27
  import './vendor-base.9c08bbd0.js';
29
28
  import 'vite-node/constants';
29
+ import './vendor-global.c3664e75.js';
30
30
 
31
31
  async function init(ctx) {
32
- const { config, workerId: workerId$1 } = ctx;
32
+ const { config, workerId: workerId$1, providedContext } = ctx;
33
33
  process.env.VITEST_WORKER_ID = String(workerId$1);
34
34
  process.env.VITEST_POOL_ID = String(workerId);
35
35
  try {
@@ -81,9 +81,15 @@ async function init(ctx) {
81
81
  prepare: performance.now()
82
82
  },
83
83
  rpc,
84
+ providedContext,
84
85
  isChildProcess: true
85
86
  };
86
- globalThis.__vitest_worker__ = state;
87
+ Object.defineProperty(globalThis, "__vitest_worker__", {
88
+ value: state,
89
+ configurable: true,
90
+ writable: true,
91
+ enumerable: false
92
+ });
87
93
  if (ctx.invalidates) {
88
94
  ctx.invalidates.forEach((fsPath) => {
89
95
  moduleCache.delete(fsPath);
@@ -13,13 +13,13 @@ import require$$2$1 from 'http';
13
13
  import require$$7 from 'url';
14
14
  import { g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8.js';
15
15
  import { A as API_PATH } from './vendor-constants.538d9b49.js';
16
- import './vendor-index.29282562.js';
16
+ import './vendor-index.2b92937b.js';
17
17
  import '@vitest/utils';
18
18
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
19
19
  import { i as isPrimitive } from './vendor-base.9c08bbd0.js';
20
20
  import 'std-env';
21
21
  import '@vitest/runner/utils';
22
- import './vendor-global.97e4527c.js';
22
+ import './vendor-global.c3664e75.js';
23
23
 
24
24
  async function getModuleGraph(ctx, id) {
25
25
  const graph = {};
@@ -4604,6 +4604,10 @@ function setup(vitestOrWorkspace, server) {
4604
4604
  },
4605
4605
  getCountOfFailedTests() {
4606
4606
  return ctx.state.getCountOfFailedTests();
4607
+ },
4608
+ // browser should have a separate RPC in the future, UI doesn't care for provided context
4609
+ getProvidedContext() {
4610
+ return "ctx" in vitestOrWorkspace ? vitestOrWorkspace.getProvidedContext() : {};
4607
4611
  }
4608
4612
  },
4609
4613
  {
@@ -4645,8 +4649,6 @@ class WebSocketReporter {
4645
4649
  const parserOptions = {
4646
4650
  getSourceMap: (file) => project.getBrowserSourceMapModuleById(file)
4647
4651
  };
4648
- if ((result == null ? void 0 : result.error) && !isPrimitive(result.error))
4649
- result.error.stacks = parseErrorStacktrace(result.error, parserOptions);
4650
4652
  (_a = result == null ? void 0 : result.errors) == null ? void 0 : _a.forEach((error) => {
4651
4653
  if (!isPrimitive(error))
4652
4654
  error.stacks = parseErrorStacktrace(error, parserOptions);
@@ -3,8 +3,8 @@ import f from 'path';
3
3
  import { g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8.js';
4
4
  import require$$0 from 'util';
5
5
  import require$$0$2 from 'child_process';
6
- import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.e006069f.js';
7
- import { o as onetimeExports } from './vendor-node.e5a35bfe.js';
6
+ import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.8efe7746.js';
7
+ import { o as onetimeExports } from './vendor-node.65461b16.js';
8
8
  import require$$0$1 from 'os';
9
9
  import 'node:buffer';
10
10
  import 'node:path';
@@ -26,11 +26,11 @@ import 'vite-node/utils';
26
26
  import 'vite-node/client';
27
27
  import '@vitest/snapshot/manager';
28
28
  import 'vite-node/server';
29
- import './vendor-index.29282562.js';
29
+ import './vendor-index.2b92937b.js';
30
30
  import 'std-env';
31
31
  import '@vitest/runner/utils';
32
32
  import '@vitest/utils';
33
- import './vendor-global.97e4527c.js';
33
+ import './vendor-global.c3664e75.js';
34
34
  import './vendor-coverage.78040316.js';
35
35
  import './vendor-paths.84fc7a99.js';
36
36
  import 'node:v8';
@@ -39,26 +39,24 @@ import 'tinypool';
39
39
  import './vendor-index.1ca68bd5.js';
40
40
  import './vendor-base.9c08bbd0.js';
41
41
  import 'node:worker_threads';
42
- import 'local-pkg';
43
- import './vendor-reporters.2953082e.js';
42
+ import 'node:fs/promises';
44
43
  import 'node:perf_hooks';
44
+ import '@vitest/utils/source-map';
45
+ import 'local-pkg';
46
+ import 'module';
47
+ import 'acorn';
48
+ import 'acorn-walk';
49
+ import './vendor-reporters.d24d80a4.js';
45
50
  import './chunk-runtime-console.f3263f87.js';
46
51
  import 'node:stream';
47
52
  import 'node:console';
48
53
  import './vendor-date.6e993429.js';
49
54
  import './vendor-tasks.f9d75aed.js';
50
- import '@vitest/utils/source-map';
51
55
  import 'node:module';
52
56
  import 'node:crypto';
53
- import 'node:fs/promises';
54
- import 'module';
55
- import 'acorn';
56
- import 'acorn-walk';
57
57
  import 'magic-string';
58
58
  import 'strip-literal';
59
- import './vendor-environments.094f240c.js';
60
- import './vendor-index.0b5b3600.js';
61
- import 'node:assert';
59
+ import './vendor-environments.dcc4a34e.js';
62
60
  import 'node:readline';
63
61
  import 'readline';
64
62
 
@@ -1,15 +1,15 @@
1
1
  import { g as globalApis } from './vendor-constants.538d9b49.js';
2
- import { i as index } from './vendor-index.68ecee35.js';
2
+ import { i as index } from './vendor-index.72df742e.js';
3
3
  import '@vitest/runner';
4
- import './vendor-benchmark.44931cfa.js';
4
+ import './vendor-benchmark.b6befc50.js';
5
5
  import '@vitest/runner/utils';
6
6
  import '@vitest/utils';
7
- import './vendor-index.29282562.js';
7
+ import './vendor-index.2b92937b.js';
8
8
  import 'pathe';
9
9
  import 'std-env';
10
- import './vendor-global.97e4527c.js';
11
- import './vendor-run-once.3e5ef7d7.js';
12
- import './vendor-vi.d30b47ae.js';
10
+ import './vendor-global.c3664e75.js';
11
+ import './vendor-run-once.fb836747.js';
12
+ import './vendor-vi.3baa7c4a.js';
13
13
  import 'chai';
14
14
  import './vendor-_commonjsHelpers.7d1333e8.js';
15
15
  import '@vitest/expect';
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'pathe';
2
- import { e as execa } from './vendor-index.e006069f.js';
2
+ import { e as execa } from './vendor-index.8efe7746.js';
3
3
  import 'node:buffer';
4
4
  import 'node:path';
5
5
  import 'node:child_process';
@@ -1,6 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import c from 'picocolors';
3
- import { e as execa } from './vendor-index.e006069f.js';
3
+ import { e as execa } from './vendor-index.8efe7746.js';
4
4
  import { E as EXIT_CODE_RESTART } from './vendor-constants.538d9b49.js';
5
5
  import 'node:buffer';
6
6
  import 'node:path';
package/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
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 } from './vendor-node.e5a35bfe.js';
5
- import './vendor-index.29282562.js';
6
- import { d as divider } from './vendor-reporters.2953082e.js';
4
+ import { v as version, s as startVitest } from './vendor-node.65461b16.js';
5
+ import './vendor-index.2b92937b.js';
6
+ import { d as divider } from './vendor-reporters.d24d80a4.js';
7
7
  import { t as toArray } from './vendor-base.9c08bbd0.js';
8
8
  import 'vite';
9
9
  import 'node:path';
@@ -31,10 +31,9 @@ import 'tinypool';
31
31
  import './vendor-index.1ca68bd5.js';
32
32
  import 'node:worker_threads';
33
33
  import '@vitest/utils';
34
- import 'local-pkg';
35
- import 'std-env';
36
- import 'node:crypto';
37
- import './vendor-index.e006069f.js';
34
+ import 'node:fs/promises';
35
+ import 'node:perf_hooks';
36
+ import './vendor-index.8efe7746.js';
38
37
  import 'node:buffer';
39
38
  import 'node:child_process';
40
39
  import 'child_process';
@@ -42,35 +41,36 @@ import 'assert';
42
41
  import 'buffer';
43
42
  import 'node:util';
44
43
  import '@vitest/utils/source-map';
45
- import 'node:fs/promises';
44
+ import 'local-pkg';
45
+ import 'std-env';
46
46
  import 'module';
47
47
  import 'acorn';
48
48
  import 'acorn-walk';
49
49
  import '@vitest/runner/utils';
50
+ import 'node:crypto';
50
51
  import 'magic-string';
51
52
  import 'strip-literal';
52
- import './vendor-environments.094f240c.js';
53
- import './vendor-index.0b5b3600.js';
54
- import 'node:module';
55
- import 'node:assert';
53
+ import './vendor-environments.dcc4a34e.js';
56
54
  import 'node:console';
57
55
  import 'node:readline';
58
56
  import 'readline';
59
- import './vendor-global.97e4527c.js';
60
- import 'node:perf_hooks';
57
+ import './vendor-global.c3664e75.js';
61
58
  import './chunk-runtime-console.f3263f87.js';
62
59
  import 'node:stream';
63
60
  import './vendor-date.6e993429.js';
64
61
  import './vendor-tasks.f9d75aed.js';
62
+ import 'node:module';
65
63
 
66
64
  const cli = cac("vitest");
67
- cli.version(version).option("-r, --root <path>", "Root path").option("-c, --config <path>", "Path to config file").option("-u, --update", "Update snapshot").option("-w, --watch", "Enable watch mode").option("-t, --testNamePattern <pattern>", "Run tests with full names matching the specified regexp pattern").option("--dir <path>", "Base directory to scan for the test files").option("--ui", "Enable UI").option("--open", "Open UI automatically (default: !process.env.CI))").option("--api [api]", "Serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--reporter <name>", "Specify reporters").option("--outputFile <filename/-s>", "Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "Enable coverage report").option("--run", "Disable watch mode").option("--mode <name>", "Override Vite mode (default: test)").option("--globals", "Inject apis globally").option("--dom", "Mock browser api with happy-dom").option("--browser [options]", "Run tests in the browser (default: false)").option("--pool <pool>", "Specify pool, if not running in the browser (default: threads)").option("--poolOptions <options>", "Specify pool options").option("--poolOptions.threads.isolate", "Isolate tests in threads pool (default: true)").option("--poolOptions.forks.isolate", "Isolate tests in forks pool (default: true)").option("--environment <env>", "Specify runner environment, if not running in the browser (default: node)").option("--passWithNoTests", "Pass when no tests found").option("--logHeapUsage", "Show the size of heap for each test").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--dangerouslyIgnoreUnhandledErrors", "Ignore any unhandled errors that occur").option("--shard <shard>", "Test suite shard to execute in a format of <index>/<count>").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").option("--sequence <options>", "Define in what order to run tests (use --sequence.shuffle to run tests in random order, use --sequence.concurrent to run tests in parallel)").option("--segfaultRetry <times>", "Return tests on segment fault (default: 0)", { default: 0 }).option("--no-color", "Removes colors from the console output").option("--inspect", "Enable Node.js inspector").option("--inspect-brk", "Enable Node.js inspector with break").option("--test-timeout <time>", "Default timeout of a test in milliseconds (default: 5000)").option("--bail <number>", "Stop test execution when given number of tests have failed", { default: 0 }).option("--retry <times>", "Retry the test specific number of times if it fails", { default: 0 }).option("--diff <path>", "Path to a diff config that will be used to generate diff interface").help();
65
+ cli.version(version).option("-r, --root <path>", "Root path").option("-c, --config <path>", "Path to config file").option("-u, --update", "Update snapshot").option("-w, --watch", "Enable watch mode").option("-t, --testNamePattern <pattern>", "Run tests with full names matching the specified regexp pattern").option("--dir <path>", "Base directory to scan for the test files").option("--ui", "Enable UI").option("--open", "Open UI automatically (default: !process.env.CI))").option("--api [api]", "Serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--reporter <name>", "Specify reporters").option("--outputFile <filename/-s>", "Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "Enable coverage report", { default: { 100: false } }).option("--run", "Disable watch mode").option("--mode <name>", "Override Vite mode (default: test)").option("--globals", "Inject apis globally").option("--dom", "Mock browser api with happy-dom").option("--browser [options]", "Run tests in the browser (default: false)").option("--pool <pool>", "Specify pool, if not running in the browser (default: threads)").option("--poolOptions <options>", "Specify pool options").option("--poolOptions.threads.isolate", "Isolate tests in threads pool (default: true)").option("--poolOptions.forks.isolate", "Isolate tests in forks pool (default: true)").option("--environment <env>", "Specify runner environment, if not running in the browser (default: node)").option("--passWithNoTests", "Pass when no tests found").option("--logHeapUsage", "Show the size of heap for each test").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--dangerouslyIgnoreUnhandledErrors", "Ignore any unhandled errors that occur").option("--shard <shard>", "Test suite shard to execute in a format of <index>/<count>").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").option("--sequence <options>", "Define in what order to run tests (use --sequence.shuffle to run tests in random order, use --sequence.concurrent to run tests in parallel)").option("--segfaultRetry <times>", "Return tests on segment fault (default: 0)", { default: 0 }).option("--no-color", "Removes colors from the console output").option("--inspect", "Enable Node.js inspector").option("--inspect-brk", "Enable Node.js inspector with break").option("--test-timeout <time>", "Default timeout of a test in milliseconds (default: 5000)").option("--bail <number>", "Stop test execution when given number of tests have failed", { default: 0 }).option("--retry <times>", "Retry the test specific number of times if it fails", { default: 0 }).option("--diff <path>", "Path to a diff config that will be used to generate diff interface").option("--expand-snapshot-diff", "Show full diff when snapshot fails").option("--typecheck [options]", "Custom options for typecheck pool").option("--typecheck.enabled", "Enable typechecking alongside tests (default: false)").option("--typecheck.only", "Run only typecheck tests. This automatically enables typecheck (default: false)").help();
68
66
  cli.command("run [...filters]").action(run);
69
67
  cli.command("related [...filters]").action(runRelated);
70
68
  cli.command("watch [...filters]").action(watch);
71
69
  cli.command("dev [...filters]").action(watch);
72
70
  cli.command("bench [...filters]").action(benchmark);
73
- cli.command("typecheck [...filters]").action(typecheck);
71
+ cli.command("typecheck [...filters]").action(() => {
72
+ throw new Error(`Running typecheck via "typecheck" command is removed. Please use "--typecheck" to run your regular tests alongside typechecking, or "--typecheck.only" to run only typecheck tests.`);
73
+ });
74
74
  cli.command("[...filters]").action((filters, options) => start("test", filters, options));
75
75
  try {
76
76
  cli.parse();
@@ -106,10 +106,6 @@ async function benchmark(cliFilters, options) {
106
106
  console.warn(c.yellow("Benchmarking is an experimental feature.\nBreaking changes might not follow semver, please pin Vitest's version when using it."));
107
107
  await start("benchmark", cliFilters, options);
108
108
  }
109
- async function typecheck(cliFilters = [], options = {}) {
110
- console.warn(c.yellow("Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow semver, please pin Vitest's version when using it."));
111
- await start("typecheck", cliFilters, options);
112
- }
113
109
  function normalizeCliOptions(argv) {
114
110
  if (argv.root)
115
111
  argv.root = normalize(argv.root);
package/dist/config.cjs CHANGED
@@ -11,6 +11,7 @@ const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**
11
11
  const defaultCoverageExcludes = [
12
12
  "coverage/**",
13
13
  "dist/**",
14
+ "**/[.]**",
14
15
  "packages/*/test?(s)/**",
15
16
  "**/*.d.ts",
16
17
  "**/virtual:*",
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
2
2
  export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
3
- import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-d10f25e1.js';
3
+ import { a as ResolvedCoverageOptions, U as UserConfig, C as CoverageV8Options, P as ProjectConfig } from './reporters-50c2bd49.js';
4
4
  import '@vitest/runner';
5
5
  import 'vite-node';
6
6
  import '@vitest/snapshot';
@@ -12,7 +12,6 @@ import 'vite-node/client';
12
12
  import '@vitest/snapshot/manager';
13
13
  import 'vite-node/server';
14
14
  import 'node:worker_threads';
15
- import 'rollup';
16
15
  import 'node:fs';
17
16
  import 'chai';
18
17
 
@@ -24,7 +23,7 @@ declare const config: {
24
23
  watch: boolean;
25
24
  globals: boolean;
26
25
  environment: "node";
27
- pool: string;
26
+ pool: "threads";
28
27
  clearMocks: boolean;
29
28
  restoreMocks: boolean;
30
29
  mockReset: boolean;
package/dist/config.js CHANGED
@@ -9,6 +9,7 @@ const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**
9
9
  const defaultCoverageExcludes = [
10
10
  "coverage/**",
11
11
  "dist/**",
12
+ "**/[.]**",
12
13
  "packages/*/test?(s)/**",
13
14
  "**/*.d.ts",
14
15
  "**/virtual:*",
@@ -1,4 +1,4 @@
1
- import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-d10f25e1.js';
1
+ import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-50c2bd49.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
@@ -11,7 +11,6 @@ import 'vite-node/client';
11
11
  import '@vitest/snapshot/manager';
12
12
  import 'vite-node/server';
13
13
  import 'node:worker_threads';
14
- import 'rollup';
15
14
  import 'node:fs';
16
15
  import 'chai';
17
16
 
package/dist/coverage.js CHANGED
@@ -12,7 +12,7 @@ class BaseCoverageProvider {
12
12
  const summaries = perFile ? coverageMap.files().map((file) => coverageMap.fileCoverageFor(file).toSummary()) : [coverageMap.getCoverageSummary()];
13
13
  const thresholdsToUpdate = [];
14
14
  for (const key of THRESHOLD_KEYS) {
15
- const threshold = thresholds[key] || 100;
15
+ const threshold = thresholds[key] ?? 100;
16
16
  const actual = Math.min(...summaries.map((summary) => summary[key].pct));
17
17
  if (actual > threshold)
18
18
  thresholdsToUpdate.push([key, actual]);
@@ -22,7 +22,7 @@ class BaseCoverageProvider {
22
22
  const originalConfig = readFileSync(configurationFile, "utf8");
23
23
  let updatedConfig = originalConfig;
24
24
  for (const [threshold, newValue] of thresholdsToUpdate) {
25
- const previousThreshold = (thresholds[threshold] || 100).toString();
25
+ const previousThreshold = (thresholds[threshold] ?? 100).toString();
26
26
  const pattern = new RegExp(`(${threshold}\\s*:\\s*)${previousThreshold.replace(".", "\\.")}`);
27
27
  const matches = originalConfig.match(pattern);
28
28
  if (matches)
package/dist/entry-vm.js CHANGED
@@ -5,23 +5,23 @@ import timers from 'node:timers';
5
5
  import { performance } from 'node:perf_hooks';
6
6
  import { startTests } from '@vitest/runner';
7
7
  import { setupColors, createColors } from '@vitest/utils';
8
- import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.d36f5516.js';
8
+ import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.57925a34.js';
9
9
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
10
- import { g as getWorkerState } from './vendor-global.97e4527c.js';
11
- import { i as index } from './vendor-index.68ecee35.js';
10
+ import { g as getWorkerState } from './vendor-global.c3664e75.js';
11
+ import { i as index } from './vendor-index.72df742e.js';
12
12
  import { setupCommonEnv } from './browser.js';
13
13
  import 'chai';
14
14
  import '@vitest/snapshot/environment';
15
15
  import 'pathe';
16
16
  import './vendor-paths.84fc7a99.js';
17
17
  import 'node:url';
18
- import './vendor-rpc.cbd8e972.js';
19
- import './vendor-benchmark.44931cfa.js';
18
+ import './vendor-rpc.171f65fb.js';
19
+ import './vendor-benchmark.b6befc50.js';
20
20
  import '@vitest/runner/utils';
21
- import './vendor-index.29282562.js';
21
+ import './vendor-index.2b92937b.js';
22
22
  import 'std-env';
23
- import './vendor-run-once.3e5ef7d7.js';
24
- import './vendor-vi.d30b47ae.js';
23
+ import './vendor-run-once.fb836747.js';
24
+ import './vendor-vi.3baa7c4a.js';
25
25
  import './vendor-_commonjsHelpers.7d1333e8.js';
26
26
  import '@vitest/expect';
27
27
  import '@vitest/snapshot';
package/dist/entry.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { startTests } from '@vitest/runner';
3
- import './vendor-index.29282562.js';
4
- import { a as globalExpect, r as resetModules, v as vi } from './vendor-vi.d30b47ae.js';
3
+ import './vendor-index.2b92937b.js';
4
+ import { a as globalExpect, r as resetModules, v as vi } from './vendor-vi.3baa7c4a.js';
5
5
  import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
6
- import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.d36f5516.js';
6
+ import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.57925a34.js';
7
7
  import { createRequire } from 'node:module';
8
8
  import util from 'node:util';
9
9
  import timers from 'node:timers';
10
10
  import { isatty } from 'node:tty';
11
11
  import { installSourcemapsSupport } from 'vite-node/source-map';
12
12
  import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
13
- import { i as index } from './vendor-index.68ecee35.js';
13
+ import { i as index } from './vendor-index.72df742e.js';
14
14
  import { setupCommonEnv } from './browser.js';
15
- import { g as getWorkerState } from './vendor-global.97e4527c.js';
15
+ import { g as getWorkerState } from './vendor-global.c3664e75.js';
16
16
  import 'pathe';
17
17
  import 'std-env';
18
18
  import '@vitest/runner/utils';
@@ -28,9 +28,9 @@ import '@vitest/spy';
28
28
  import '@vitest/snapshot/environment';
29
29
  import './vendor-paths.84fc7a99.js';
30
30
  import 'node:url';
31
- import './vendor-rpc.cbd8e972.js';
32
- import './vendor-benchmark.44931cfa.js';
33
- import './vendor-run-once.3e5ef7d7.js';
31
+ import './vendor-rpc.171f65fb.js';
32
+ import './vendor-benchmark.b6befc50.js';
33
+ import './vendor-run-once.fb836747.js';
34
34
 
35
35
  let globalSetup = false;
36
36
  async function setupGlobalEnv(config, { environment }) {
@@ -1,4 +1,4 @@
1
- import { E as Environment } from './reporters-d10f25e1.js';
1
+ import { E as Environment } from './reporters-50c2bd49.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
@@ -11,7 +11,6 @@ import 'vite-node/client';
11
11
  import '@vitest/snapshot/manager';
12
12
  import 'vite-node/server';
13
13
  import 'node:worker_threads';
14
- import 'rollup';
15
14
  import 'node:fs';
16
15
  import 'chai';
17
16
 
@@ -1,15 +1,3 @@
1
- export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.094f240c.js';
2
- import 'pathe';
3
- import './vendor-index.0b5b3600.js';
4
- import 'acorn';
5
- import 'node:module';
6
- import 'node:fs';
7
- import 'node:url';
8
- import 'node:assert';
9
- import 'node:process';
10
- import 'node:path';
11
- import 'node:v8';
12
- import 'node:util';
13
- import 'vite-node/client';
1
+ export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.dcc4a34e.js';
14
2
  import 'node:console';
15
3
  import 'local-pkg';
package/dist/execute.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import vm from 'node:vm';
2
2
  import { ViteNodeRunner } from 'vite-node/client';
3
3
  import { ViteNodeRunnerOptions } from 'vite-node';
4
- import { ah as PendingSuiteMock, ai as MockFactory, Z as WorkerGlobalState, aj as MockMap, K as RuntimeRPC } from './reporters-d10f25e1.js';
4
+ import { al as PendingSuiteMock, am as MockFactory, an as MockMap, a1 as WorkerGlobalState, Q as RuntimeRPC } from './reporters-50c2bd49.js';
5
5
  import 'vite';
6
6
  import '@vitest/runner';
7
7
  import '@vitest/snapshot';
@@ -12,7 +12,6 @@ import 'tinybench';
12
12
  import '@vitest/snapshot/manager';
13
13
  import 'vite-node/server';
14
14
  import 'node:worker_threads';
15
- import 'rollup';
16
15
  import 'node:fs';
17
16
  import 'chai';
18
17
 
@@ -126,7 +125,7 @@ declare class VitestExecutor extends ViteNodeRunner {
126
125
  Reflect: typeof Reflect;
127
126
  Symbol: SymbolConstructor;
128
127
  };
129
- get state(): WorkerGlobalState;
128
+ get state(): any;
130
129
  shouldResolveId(id: string, _importee?: string | undefined): boolean;
131
130
  originalResolveUrl(id: string, importer?: string): Promise<[url: string, fsPath: string]>;
132
131
  resolveUrl(id: string, importer?: string): Promise<[string, string]>;
package/dist/execute.js CHANGED
@@ -1,4 +1,4 @@
1
- export { V as VitestExecutor } from './vendor-execute.07d1a420.js';
1
+ export { V as VitestExecutor } from './vendor-execute.157302d6.js';
2
2
  import 'node:url';
3
3
  import 'node:vm';
4
4
  import 'vite-node/client';
@@ -6,7 +6,6 @@ import 'vite-node/utils';
6
6
  import 'pathe';
7
7
  import '@vitest/utils/error';
8
8
  import './vendor-paths.84fc7a99.js';
9
- import './vendor-global.97e4527c.js';
10
9
  import 'node:fs';
11
10
  import '@vitest/utils';
12
11
  import './vendor-base.9c08bbd0.js';