vitest 0.17.0 → 0.18.1
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.
- package/LICENSE.md +1 -1
- package/dist/{chunk-api-setup.5282c6cb.mjs → chunk-api-setup.9d3f7670.mjs} +18 -9
- package/dist/{chunk-constants.511c6e9b.mjs → chunk-constants.d4406290.mjs} +1 -1
- package/dist/{chunk-env-node.dc514f41.mjs → chunk-env-node.bbba78e5.mjs} +9 -3
- package/dist/{chunk-install-pkg.3fa50769.mjs → chunk-install-pkg.2dcb2c04.mjs} +1 -1
- package/dist/chunk-integrations-globals.00b6e1ad.mjs +23 -0
- package/dist/{chunk-runtime-chain.68f305d0.mjs → chunk-runtime-chain.b60d57da.mjs} +39 -60
- package/dist/{chunk-runtime-mocker.1c207219.mjs → chunk-runtime-mocker.1d853e3a.mjs} +77 -29
- package/dist/{chunk-runtime-rpc.5e78af38.mjs → chunk-runtime-rpc.9d1f4c48.mjs} +1 -1
- package/dist/{chunk-utils-global.79a8b1cc.mjs → chunk-utils-global.0a7416cf.mjs} +70 -6
- package/dist/{chunk-utils-source-map.f52527bc.mjs → chunk-utils-source-map.c03f8bc4.mjs} +2 -2
- package/dist/{chunk-vite-node-externalize.1efbe319.mjs → chunk-vite-node-externalize.6956d2d9.mjs} +2666 -2552
- package/dist/chunk-vite-node-utils.8077cd3c.mjs +1422 -0
- package/dist/cli.mjs +13 -13
- package/dist/config.cjs +6 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +6 -1
- package/dist/entry.mjs +638 -11
- package/dist/index.d.ts +125 -52
- package/dist/index.mjs +8 -8
- package/dist/node.d.ts +126 -54
- package/dist/node.mjs +13 -13
- package/dist/spy.mjs +102 -2
- package/dist/{vendor-index.e5dc6622.mjs → vendor-index.4bf9c627.mjs} +405 -405
- package/dist/{vendor-index.98e769c1.mjs → vendor-index.de788b6a.mjs} +7 -7
- package/dist/worker.mjs +9 -9
- package/package.json +12 -12
- package/dist/chunk-integrations-globals.6bb781c7.mjs +0 -26
- package/dist/chunk-integrations-spy.674b628e.mjs +0 -102
- package/dist/chunk-vite-node-utils.4b58ae05.mjs +0 -9192
- package/dist/vendor-entry.2edaf3e0.mjs +0 -653
package/dist/cli.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { p as picocolors } from './chunk-utils-global.
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { p as picocolors } from './chunk-utils-global.0a7416cf.mjs';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.6956d2d9.mjs';
|
|
4
|
+
import 'path';
|
|
4
5
|
import 'tty';
|
|
5
6
|
import 'local-pkg';
|
|
6
|
-
import '
|
|
7
|
-
import './chunk-env-node.dc514f41.mjs';
|
|
7
|
+
import './chunk-env-node.bbba78e5.mjs';
|
|
8
8
|
import 'fs';
|
|
9
9
|
import 'module';
|
|
10
10
|
import 'url';
|
|
11
11
|
import 'vite';
|
|
12
12
|
import 'process';
|
|
13
|
-
import './chunk-constants.
|
|
14
|
-
import 'readline';
|
|
13
|
+
import './chunk-constants.d4406290.mjs';
|
|
15
14
|
import 'os';
|
|
16
15
|
import 'util';
|
|
17
16
|
import 'stream';
|
|
18
17
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
19
|
-
import './chunk-vite-node-utils.
|
|
18
|
+
import './chunk-vite-node-utils.8077cd3c.mjs';
|
|
20
19
|
import 'vm';
|
|
21
20
|
import 'assert';
|
|
22
21
|
import 'debug';
|
|
23
22
|
import 'worker_threads';
|
|
24
23
|
import 'tinypool';
|
|
25
|
-
import 'crypto';
|
|
26
24
|
import 'perf_hooks';
|
|
27
|
-
import './chunk-utils-source-map.
|
|
28
|
-
import '
|
|
29
|
-
import 'child_process';
|
|
25
|
+
import './chunk-utils-source-map.c03f8bc4.mjs';
|
|
26
|
+
import 'crypto';
|
|
30
27
|
import 'buffer';
|
|
28
|
+
import 'child_process';
|
|
29
|
+
import './vendor-index.4bf9c627.mjs';
|
|
31
30
|
import './chunk-magic-string.efe26975.mjs';
|
|
32
|
-
import '
|
|
31
|
+
import 'readline';
|
|
32
|
+
import './vendor-index.de788b6a.mjs';
|
|
33
33
|
|
|
34
34
|
function toArr(any) {
|
|
35
35
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -645,7 +645,7 @@ class CAC extends EventEmitter {
|
|
|
645
645
|
const cac = (name = "") => new CAC(name);
|
|
646
646
|
|
|
647
647
|
const cli = cac("vitest");
|
|
648
|
-
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", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified 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("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputTruncateLength <length>", "diff output length (default: 80)").option("--outputDiffLines <lines>", "number of diff output lines (default: 15)").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of mutliple reporters").option("--coverage", "use c8 for coverage").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").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)").help();
|
|
648
|
+
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", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified 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("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputTruncateLength <length>", "diff output length (default: 80)").option("--outputDiffLines <lines>", "number of diff output lines (default: 15)").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of mutliple reporters").option("--coverage", "use c8 for coverage").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").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)").help();
|
|
649
649
|
cli.command("run [...filters]").action(run);
|
|
650
650
|
cli.command("related [...filters]").action(runRelated);
|
|
651
651
|
cli.command("watch [...filters]").action(start);
|
package/dist/config.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const defaultCoverageExcludes = [
|
|
|
12
12
|
"test{,s}/**",
|
|
13
13
|
"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}",
|
|
14
14
|
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
|
|
15
|
+
"**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
|
|
15
16
|
"**/__tests__/**",
|
|
16
17
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc}.config.{js,cjs,mjs,ts}",
|
|
17
18
|
"**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
|
|
@@ -55,7 +56,11 @@ const config = {
|
|
|
55
56
|
hookTimeout: 1e4,
|
|
56
57
|
isolate: true,
|
|
57
58
|
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
58
|
-
forceRerunTriggers: [
|
|
59
|
+
forceRerunTriggers: [
|
|
60
|
+
"**/package.json/**",
|
|
61
|
+
"**/vitest.config.*/**",
|
|
62
|
+
"**/vite.config.*/**"
|
|
63
|
+
],
|
|
59
64
|
update: false,
|
|
60
65
|
reporters: [],
|
|
61
66
|
silent: false,
|
package/dist/config.d.ts
CHANGED
package/dist/config.mjs
CHANGED
|
@@ -8,6 +8,7 @@ const defaultCoverageExcludes = [
|
|
|
8
8
|
"test{,s}/**",
|
|
9
9
|
"test{,-*}.{js,cjs,mjs,ts,tsx,jsx}",
|
|
10
10
|
"**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}",
|
|
11
|
+
"**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}",
|
|
11
12
|
"**/__tests__/**",
|
|
12
13
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc}.config.{js,cjs,mjs,ts}",
|
|
13
14
|
"**/.{eslint,mocha,prettier}rc.{js,cjs,yml}"
|
|
@@ -51,7 +52,11 @@ const config = {
|
|
|
51
52
|
hookTimeout: 1e4,
|
|
52
53
|
isolate: true,
|
|
53
54
|
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
54
|
-
forceRerunTriggers: [
|
|
55
|
+
forceRerunTriggers: [
|
|
56
|
+
"**/package.json/**",
|
|
57
|
+
"**/vitest.config.*/**",
|
|
58
|
+
"**/vite.config.*/**"
|
|
59
|
+
],
|
|
55
60
|
update: false,
|
|
56
61
|
reporters: [],
|
|
57
62
|
silent: false,
|