vitest 0.34.2 → 0.34.3
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/dist/browser.d.ts +3 -3
- package/dist/browser.js +1 -1
- package/dist/child.js +2 -2
- package/dist/{chunk-api-setup.cc5282f7.js → chunk-api-setup.3b016b1c.js} +1 -1
- package/dist/{chunk-install-pkg.7e19b3a0.js → chunk-install-pkg.a036014e.js} +4 -3
- package/dist/{chunk-integrations-globals.522ae1ae.js → chunk-integrations-globals.7f4b17bf.js} +3 -3
- package/dist/cli.js +9 -8
- package/dist/config.cjs +3 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +3 -1
- package/dist/coverage.d.ts +3 -3
- package/dist/entry-vm.js +3 -3
- package/dist/entry.js +3 -3
- package/dist/environments.d.ts +3 -3
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +3 -3
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/loader.js +1 -1
- package/dist/node.d.ts +4 -4
- package/dist/node.js +4 -3
- package/dist/{types-63abf2e0.d.ts → reporters-2ff87305.d.ts} +10 -4
- package/dist/reporters.d.ts +16 -0
- package/dist/reporters.js +16 -0
- package/dist/runners.d.ts +3 -3
- package/dist/runners.js +2 -2
- package/dist/{vendor-environments.37f266a9.js → vendor-environments.8eb4d407.js} +15 -4
- package/dist/{vendor-execute.4fc8203a.js → vendor-execute.a63e187f.js} +8 -6
- package/dist/{vendor-index.087d1af7.js → vendor-index.29282562.js} +1 -1
- package/dist/{vendor-index.b5efbd68.js → vendor-index.7178e7a2.js} +1 -1
- package/dist/{vendor-node.7b1bd3c5.js → vendor-node.5ce5f335.js} +87 -2615
- package/dist/vendor-reporters.f6975b8d.js +2584 -0
- package/dist/{vendor-vi.f8055ff2.js → vendor-vi.597d9e06.js} +1 -1
- package/dist/vm.js +2 -2
- package/dist/worker.js +2 -2
- package/package.json +11 -7
- package/reporters.d.ts +1 -0
package/dist/browser.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { startTests } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig, C as CoverageOptions, a as CoverageProvider, b as CoverageProviderModule } from './
|
|
3
|
-
import '@vitest/snapshot';
|
|
4
|
-
import '@vitest/expect';
|
|
2
|
+
import { R as ResolvedConfig, C as CoverageOptions, a as CoverageProvider, b as CoverageProviderModule } from './reporters-2ff87305.js';
|
|
5
3
|
import 'vite';
|
|
6
4
|
import 'vite-node';
|
|
5
|
+
import '@vitest/snapshot';
|
|
6
|
+
import '@vitest/expect';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'tinybench';
|
package/dist/browser.js
CHANGED
|
@@ -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.
|
|
16
|
+
(await import('./chunk-integrations-globals.7f4b17bf.js')).registerApiGlobally();
|
|
17
17
|
}
|
|
18
18
|
function setupDefines(defines) {
|
|
19
19
|
for (const key in defines)
|
package/dist/child.js
CHANGED
|
@@ -2,8 +2,8 @@ import { performance } from 'node:perf_hooks';
|
|
|
2
2
|
import v8 from 'node:v8';
|
|
3
3
|
import { c as createBirpc } from './vendor-index.b271ebe4.js';
|
|
4
4
|
import { parseRegexp } from '@vitest/utils';
|
|
5
|
-
import { l as loadEnvironment } from './vendor-environments.
|
|
6
|
-
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.
|
|
5
|
+
import { l as loadEnvironment } from './vendor-environments.8eb4d407.js';
|
|
6
|
+
import { s as startViteNode, m as moduleCache, a as mockMap } from './vendor-execute.a63e187f.js';
|
|
7
7
|
import { r as rpcDone, c as createSafeRpc } from './vendor-rpc.cbd8e972.js';
|
|
8
8
|
import { s as setupInspect } from './vendor-inspector.47fc8cbb.js';
|
|
9
9
|
import 'node:url';
|
|
@@ -13,7 +13,7 @@ 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.
|
|
16
|
+
import './vendor-index.29282562.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';
|
|
@@ -4,7 +4,7 @@ import { g as getDefaultExportFromCjs } from './vendor-_commonjsHelpers.7d1333e8
|
|
|
4
4
|
import require$$2 from 'util';
|
|
5
5
|
import require$$0$1 from 'child_process';
|
|
6
6
|
import { p as pathKeyExports, s as signalExitExports, m as mergeStream$1, g as getStreamExports, c as crossSpawnExports } from './vendor-index.1f85e5f1.js';
|
|
7
|
-
import { o as onetimeExports } from './vendor-node.
|
|
7
|
+
import { o as onetimeExports } from './vendor-node.5ce5f335.js';
|
|
8
8
|
import require$$0 from 'os';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'node:path';
|
|
@@ -26,7 +26,7 @@ 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.
|
|
29
|
+
import './vendor-index.29282562.js';
|
|
30
30
|
import 'std-env';
|
|
31
31
|
import '@vitest/runner/utils';
|
|
32
32
|
import '@vitest/utils';
|
|
@@ -39,6 +39,7 @@ import './vendor-base.9c08bbd0.js';
|
|
|
39
39
|
import 'node:worker_threads';
|
|
40
40
|
import 'tinypool';
|
|
41
41
|
import 'local-pkg';
|
|
42
|
+
import './vendor-reporters.f6975b8d.js';
|
|
42
43
|
import 'node:perf_hooks';
|
|
43
44
|
import './vendor-tasks.f9d75aed.js';
|
|
44
45
|
import '@vitest/utils/source-map';
|
|
@@ -50,7 +51,7 @@ import 'acorn';
|
|
|
50
51
|
import 'acorn-walk';
|
|
51
52
|
import 'magic-string';
|
|
52
53
|
import 'strip-literal';
|
|
53
|
-
import './vendor-environments.
|
|
54
|
+
import './vendor-environments.8eb4d407.js';
|
|
54
55
|
import './vendor-index.0b5b3600.js';
|
|
55
56
|
import 'node:assert';
|
|
56
57
|
import 'node:console';
|
package/dist/{chunk-integrations-globals.522ae1ae.js → chunk-integrations-globals.7f4b17bf.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { g as globalApis } from './vendor-constants.538d9b49.js';
|
|
2
|
-
import { i as index } from './vendor-index.
|
|
2
|
+
import { i as index } from './vendor-index.7178e7a2.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
|
-
import './vendor-vi.
|
|
4
|
+
import './vendor-vi.597d9e06.js';
|
|
5
5
|
import '@vitest/runner/utils';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import './vendor-index.
|
|
7
|
+
import './vendor-index.29282562.js';
|
|
8
8
|
import 'pathe';
|
|
9
9
|
import 'std-env';
|
|
10
10
|
import './vendor-global.97e4527c.js';
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +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
|
|
5
|
-
import './vendor-index.
|
|
4
|
+
import { v as version, s as startVitest } from './vendor-node.5ce5f335.js';
|
|
5
|
+
import './vendor-index.29282562.js';
|
|
6
|
+
import { d as divider } from './vendor-reporters.f6975b8d.js';
|
|
6
7
|
import { t as toArray } from './vendor-base.9c08bbd0.js';
|
|
7
8
|
import 'vite';
|
|
8
9
|
import 'node:path';
|
|
@@ -32,11 +33,6 @@ import 'tinypool';
|
|
|
32
33
|
import '@vitest/utils';
|
|
33
34
|
import 'local-pkg';
|
|
34
35
|
import 'std-env';
|
|
35
|
-
import 'node:perf_hooks';
|
|
36
|
-
import './vendor-tasks.f9d75aed.js';
|
|
37
|
-
import '@vitest/runner/utils';
|
|
38
|
-
import '@vitest/utils/source-map';
|
|
39
|
-
import 'node:module';
|
|
40
36
|
import 'node:crypto';
|
|
41
37
|
import './vendor-index.1f85e5f1.js';
|
|
42
38
|
import 'node:buffer';
|
|
@@ -44,19 +40,24 @@ import 'child_process';
|
|
|
44
40
|
import 'assert';
|
|
45
41
|
import 'buffer';
|
|
46
42
|
import 'node:util';
|
|
43
|
+
import '@vitest/utils/source-map';
|
|
47
44
|
import 'node:fs/promises';
|
|
48
45
|
import 'module';
|
|
49
46
|
import 'acorn';
|
|
50
47
|
import 'acorn-walk';
|
|
48
|
+
import '@vitest/runner/utils';
|
|
51
49
|
import 'magic-string';
|
|
52
50
|
import 'strip-literal';
|
|
53
|
-
import './vendor-environments.
|
|
51
|
+
import './vendor-environments.8eb4d407.js';
|
|
54
52
|
import './vendor-index.0b5b3600.js';
|
|
53
|
+
import 'node:module';
|
|
55
54
|
import 'node:assert';
|
|
56
55
|
import 'node:console';
|
|
57
56
|
import 'node:readline';
|
|
58
57
|
import 'readline';
|
|
59
58
|
import './vendor-global.97e4527c.js';
|
|
59
|
+
import 'node:perf_hooks';
|
|
60
|
+
import './vendor-tasks.f9d75aed.js';
|
|
60
61
|
|
|
61
62
|
const cli = cac("vitest");
|
|
62
63
|
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("--threads", "Enabled threads (default: true)").option("--single-thread", "Run tests inside a single thread, requires --threads (default: false)").option("--experimental-vm-threads", "Run tests in a worker pool using VM isolation (default: false)").option("--experimental-vm-worker-memory-limit", "Set the maximum allowed memory for a worker. When reached, a new worker will be created instead").option("--silent", "Silent console output from tests").option("--hideSkippedTests", "Hide logs for skipped tests").option("--isolate", "Isolate environment for each test file (default: true)").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("--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 }).help();
|
package/dist/config.cjs
CHANGED
|
@@ -22,6 +22,7 @@ const defaultCoverageExcludes = [
|
|
|
22
22
|
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)",
|
|
23
23
|
"**/__tests__/**",
|
|
24
24
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
25
|
+
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
25
26
|
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
|
|
26
27
|
];
|
|
27
28
|
const coverageConfigDefaults = {
|
|
@@ -33,7 +34,8 @@ const coverageConfigDefaults = {
|
|
|
33
34
|
exclude: defaultCoverageExcludes,
|
|
34
35
|
reportOnFailure: false,
|
|
35
36
|
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
|
|
36
|
-
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"]
|
|
37
|
+
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"],
|
|
38
|
+
allowExternal: false
|
|
37
39
|
};
|
|
38
40
|
const fakeTimersDefaults = {
|
|
39
41
|
loopLimit: 1e4,
|
package/dist/config.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { c as ResolvedCoverageOptions, U as UserConfig, d as CoverageV8Options, P as ProjectConfig } from './
|
|
4
|
-
import '@vitest/snapshot';
|
|
5
|
-
import '@vitest/expect';
|
|
3
|
+
import { c as ResolvedCoverageOptions, U as UserConfig, d as CoverageV8Options, P as ProjectConfig } from './reporters-2ff87305.js';
|
|
6
4
|
import '@vitest/runner';
|
|
7
5
|
import 'vite-node';
|
|
6
|
+
import '@vitest/snapshot';
|
|
7
|
+
import '@vitest/expect';
|
|
8
8
|
import '@vitest/runner/utils';
|
|
9
9
|
import '@vitest/utils';
|
|
10
10
|
import 'tinybench';
|
package/dist/config.js
CHANGED
|
@@ -20,6 +20,7 @@ const defaultCoverageExcludes = [
|
|
|
20
20
|
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)",
|
|
21
21
|
"**/__tests__/**",
|
|
22
22
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
23
|
+
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
23
24
|
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
|
|
24
25
|
];
|
|
25
26
|
const coverageConfigDefaults = {
|
|
@@ -31,7 +32,8 @@ const coverageConfigDefaults = {
|
|
|
31
32
|
exclude: defaultCoverageExcludes,
|
|
32
33
|
reportOnFailure: false,
|
|
33
34
|
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
|
|
34
|
-
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"]
|
|
35
|
+
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"],
|
|
36
|
+
allowExternal: false
|
|
35
37
|
};
|
|
36
38
|
const fakeTimersDefaults = {
|
|
37
39
|
loopLimit: 1e4,
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BaseCoverageOptions, c as ResolvedCoverageOptions } from './
|
|
2
|
-
import '@vitest/snapshot';
|
|
3
|
-
import '@vitest/expect';
|
|
1
|
+
import { B as BaseCoverageOptions, c as ResolvedCoverageOptions } from './reporters-2ff87305.js';
|
|
4
2
|
import 'vite';
|
|
5
3
|
import '@vitest/runner';
|
|
6
4
|
import 'vite-node';
|
|
5
|
+
import '@vitest/snapshot';
|
|
6
|
+
import '@vitest/expect';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'tinybench';
|
package/dist/entry-vm.js
CHANGED
|
@@ -6,7 +6,7 @@ import { setupColors, createColors } from '@vitest/utils';
|
|
|
6
6
|
import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.9378c9a4.js';
|
|
7
7
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
|
|
8
8
|
import { g as getWorkerState } from './vendor-global.97e4527c.js';
|
|
9
|
-
import { i as index } from './vendor-index.
|
|
9
|
+
import { i as index } from './vendor-index.7178e7a2.js';
|
|
10
10
|
import { setupCommonEnv } from './browser.js';
|
|
11
11
|
import 'chai';
|
|
12
12
|
import '@vitest/snapshot/environment';
|
|
@@ -14,9 +14,9 @@ import 'pathe';
|
|
|
14
14
|
import './vendor-paths.84fc7a99.js';
|
|
15
15
|
import 'node:url';
|
|
16
16
|
import './vendor-rpc.cbd8e972.js';
|
|
17
|
-
import './vendor-vi.
|
|
17
|
+
import './vendor-vi.597d9e06.js';
|
|
18
18
|
import '@vitest/runner/utils';
|
|
19
|
-
import './vendor-index.
|
|
19
|
+
import './vendor-index.29282562.js';
|
|
20
20
|
import 'std-env';
|
|
21
21
|
import './vendor-_commonjsHelpers.7d1333e8.js';
|
|
22
22
|
import '@vitest/expect';
|
package/dist/entry.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests } from '@vitest/runner';
|
|
3
|
-
import './vendor-index.
|
|
4
|
-
import { d as globalExpect, r as resetModules, v as vi } from './vendor-vi.
|
|
3
|
+
import './vendor-index.29282562.js';
|
|
4
|
+
import { d as globalExpect, r as resetModules, v as vi } from './vendor-vi.597d9e06.js';
|
|
5
5
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './vendor-coverage.78040316.js';
|
|
6
6
|
import { V as VitestSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './vendor-index.9378c9a4.js';
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import { isatty } from 'node:tty';
|
|
9
9
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
10
10
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
11
|
-
import { i as index } from './vendor-index.
|
|
11
|
+
import { i as index } from './vendor-index.7178e7a2.js';
|
|
12
12
|
import { setupCommonEnv } from './browser.js';
|
|
13
13
|
import { g as getWorkerState } from './vendor-global.97e4527c.js';
|
|
14
14
|
import 'pathe';
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as Environment } from './
|
|
2
|
-
import '@vitest/snapshot';
|
|
3
|
-
import '@vitest/expect';
|
|
1
|
+
import { E as Environment } from './reporters-2ff87305.js';
|
|
4
2
|
import 'vite';
|
|
5
3
|
import '@vitest/runner';
|
|
6
4
|
import 'vite-node';
|
|
5
|
+
import '@vitest/snapshot';
|
|
6
|
+
import '@vitest/expect';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'tinybench';
|
package/dist/environments.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './vendor-environments.8eb4d407.js';
|
|
2
2
|
import 'node:url';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import './vendor-index.0b5b3600.js';
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import vm from 'node:vm';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
3
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
4
|
-
import { h as PendingSuiteMock, M as MockFactory, i as WorkerGlobalState, j as MockMap, k as RuntimeRPC } from './
|
|
5
|
-
import '@vitest/snapshot';
|
|
6
|
-
import '@vitest/expect';
|
|
4
|
+
import { h as PendingSuiteMock, M as MockFactory, i as WorkerGlobalState, j as MockMap, k as RuntimeRPC } from './reporters-2ff87305.js';
|
|
7
5
|
import 'vite';
|
|
8
6
|
import '@vitest/runner';
|
|
7
|
+
import '@vitest/snapshot';
|
|
8
|
+
import '@vitest/expect';
|
|
9
9
|
import '@vitest/runner/utils';
|
|
10
10
|
import '@vitest/utils';
|
|
11
11
|
import 'tinybench';
|
package/dist/execute.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Test, File, TaskResultPack, CancelReason } from '@vitest/runner';
|
|
2
2
|
export { DoneCallback, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
3
|
-
import { l as BenchmarkAPI, F as FakeTimerInstallOpts, m as MockFactoryWithHelper, n as RuntimeConfig, A as AfterSuiteRunMeta, o as UserConsoleLog, R as ResolvedConfig, p as ModuleGraphData, q as Reporter } from './
|
|
4
|
-
export { I as ApiConfig, a4 as ArgumentsType, a3 as Arrayable, a1 as Awaitable, B as BaseCoverageOptions, ai as BenchFunction, ag as Benchmark, ah as BenchmarkResult, af as BenchmarkUserOptions, y as BuiltinEnvironment, G as CSSModuleScopeStrategy, u as CollectLineNumbers, v as CollectLines, a6 as Constructable, x as Context, Z as ContextRPC, X as ContextTestEnvironment, ad as CoverageIstanbulOptions, C as CoverageOptions, a as CoverageProvider, b as CoverageProviderModule, ac as CoverageReporter, d as CoverageV8Options, ae as CustomProviderOptions, L as DepsOptimizationOptions, E as Environment, K as EnvironmentOptions, a8 as EnvironmentReturn, H as HappyDOMOptions, O as InlineConfig, J as JSDOMOptions, a7 as ModuleCache, a5 as MutableArray, a2 as Nullable, aa as OnServerRestartHandler, P as ProjectConfig, r as RawErrsMap, ab as ReportContext, $ as ResolveIdFunction, c as ResolvedCoverageOptions, Y as ResolvedTestEnvironment, w as RootAndTarget, S as RunnerRPC, k as RuntimeRPC, N as TransformModePatterns, t as TscErrorInfo, Q as TypecheckConfig, U as UserConfig, e as Vitest, z as VitestEnvironment, D as VitestPool, V as VitestRunMode, a9 as VmEnvironmentReturn, _ as WorkerContext, i as WorkerGlobalState, a0 as WorkerRPC } from './
|
|
3
|
+
import { l as BenchmarkAPI, F as FakeTimerInstallOpts, m as MockFactoryWithHelper, n as RuntimeConfig, A as AfterSuiteRunMeta, o as UserConsoleLog, R as ResolvedConfig, p as ModuleGraphData, q as Reporter } from './reporters-2ff87305.js';
|
|
4
|
+
export { I as ApiConfig, a4 as ArgumentsType, a3 as Arrayable, a1 as Awaitable, B as BaseCoverageOptions, ai as BenchFunction, ag as Benchmark, ah as BenchmarkResult, af as BenchmarkUserOptions, y as BuiltinEnvironment, G as CSSModuleScopeStrategy, u as CollectLineNumbers, v as CollectLines, a6 as Constructable, x as Context, Z as ContextRPC, X as ContextTestEnvironment, ad as CoverageIstanbulOptions, C as CoverageOptions, a as CoverageProvider, b as CoverageProviderModule, ac as CoverageReporter, d as CoverageV8Options, ae as CustomProviderOptions, L as DepsOptimizationOptions, E as Environment, K as EnvironmentOptions, a8 as EnvironmentReturn, H as HappyDOMOptions, O as InlineConfig, J as JSDOMOptions, a7 as ModuleCache, a5 as MutableArray, a2 as Nullable, aa as OnServerRestartHandler, P as ProjectConfig, r as RawErrsMap, ab as ReportContext, $ as ResolveIdFunction, c as ResolvedCoverageOptions, Y as ResolvedTestEnvironment, w as RootAndTarget, S as RunnerRPC, k as RuntimeRPC, N as TransformModePatterns, t as TscErrorInfo, Q as TypecheckConfig, U as UserConfig, e as Vitest, z as VitestEnvironment, D as VitestPool, V as VitestRunMode, a9 as VmEnvironmentReturn, _ as WorkerContext, i as WorkerGlobalState, a0 as WorkerRPC } from './reporters-2ff87305.js';
|
|
5
5
|
import { ExpectStatic } from '@vitest/expect';
|
|
6
6
|
export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
7
7
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, EnhancedSpy } from '@vitest/spy';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
2
|
-
export { e as bench, c as createExpect, d as expect, v as vi, f as vitest } from './vendor-vi.
|
|
2
|
+
export { e as bench, c as createExpect, d as expect, v as vi, f as vitest } from './vendor-vi.597d9e06.js';
|
|
3
3
|
export { i as isFirstRun, r as runOnce } from './vendor-run-once.3e5ef7d7.js';
|
|
4
|
-
import { d as dist } from './vendor-index.
|
|
5
|
-
export { b as assertType, g as getRunningMode, a as isWatchMode } from './vendor-index.
|
|
4
|
+
import { d as dist } from './vendor-index.7178e7a2.js';
|
|
5
|
+
export { b as assertType, g as getRunningMode, a as isWatchMode } from './vendor-index.7178e7a2.js';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
export { chai };
|
|
8
8
|
export { assert, should } from 'chai';
|
|
9
9
|
import '@vitest/runner/utils';
|
|
10
10
|
import '@vitest/utils';
|
|
11
|
-
import './vendor-index.
|
|
11
|
+
import './vendor-index.29282562.js';
|
|
12
12
|
import 'pathe';
|
|
13
13
|
import 'std-env';
|
|
14
14
|
import './vendor-global.97e4527c.js';
|
package/dist/loader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.0b5b3600.js';
|
|
4
4
|
import { normalizeModuleId } from 'vite-node/utils';
|
|
5
|
-
import './vendor-index.
|
|
5
|
+
import './vendor-index.29282562.js';
|
|
6
6
|
import { g as getWorkerState } from './vendor-global.97e4527c.js';
|
|
7
7
|
import 'acorn';
|
|
8
8
|
import 'node:module';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { V as VitestRunMode, U as UserConfig, e as Vitest, T as TestSequencer, W as WorkspaceSpec } from './
|
|
2
|
-
export { g as TestSequencerConstructor, f as VitestWorkspace, s as startVitest } from './
|
|
1
|
+
import { V as VitestRunMode, U as UserConfig, e as Vitest, T as TestSequencer, W as WorkspaceSpec } from './reporters-2ff87305.js';
|
|
2
|
+
export { g as TestSequencerConstructor, f as VitestWorkspace, s as startVitest } from './reporters-2ff87305.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
|
-
import '@vitest/snapshot';
|
|
5
|
-
import '@vitest/expect';
|
|
6
4
|
import '@vitest/runner';
|
|
7
5
|
import 'vite-node';
|
|
6
|
+
import '@vitest/snapshot';
|
|
7
|
+
import '@vitest/expect';
|
|
8
8
|
import '@vitest/runner/utils';
|
|
9
9
|
import '@vitest/utils';
|
|
10
10
|
import 'tinybench';
|
package/dist/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, r as registerConsoleShortcuts, s as startVitest } from './vendor-node.5ce5f335.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'node:path';
|
|
@@ -18,7 +18,7 @@ import 'vite-node/utils';
|
|
|
18
18
|
import 'vite-node/client';
|
|
19
19
|
import '@vitest/snapshot/manager';
|
|
20
20
|
import 'vite-node/server';
|
|
21
|
-
import './vendor-index.
|
|
21
|
+
import './vendor-index.29282562.js';
|
|
22
22
|
import 'std-env';
|
|
23
23
|
import '@vitest/runner/utils';
|
|
24
24
|
import '@vitest/utils';
|
|
@@ -33,6 +33,7 @@ import 'node:worker_threads';
|
|
|
33
33
|
import 'node:os';
|
|
34
34
|
import 'tinypool';
|
|
35
35
|
import 'local-pkg';
|
|
36
|
+
import './vendor-reporters.f6975b8d.js';
|
|
36
37
|
import 'node:perf_hooks';
|
|
37
38
|
import './vendor-tasks.f9d75aed.js';
|
|
38
39
|
import '@vitest/utils/source-map';
|
|
@@ -50,7 +51,7 @@ import 'acorn';
|
|
|
50
51
|
import 'acorn-walk';
|
|
51
52
|
import 'magic-string';
|
|
52
53
|
import 'strip-literal';
|
|
53
|
-
import './vendor-environments.
|
|
54
|
+
import './vendor-environments.8eb4d407.js';
|
|
54
55
|
import './vendor-index.0b5b3600.js';
|
|
55
56
|
import 'node:assert';
|
|
56
57
|
import 'node:console';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SnapshotResult, SnapshotStateOptions, SnapshotState } from '@vitest/snapshot';
|
|
2
|
-
import { ExpectStatic } from '@vitest/expect';
|
|
3
1
|
import * as vite from 'vite';
|
|
4
2
|
import { ViteDevServer, UserConfig as UserConfig$1, TransformResult as TransformResult$1, CommonServerOptions, DepOptimizationConfig, AliasOptions } from 'vite';
|
|
5
3
|
import * as _vitest_runner from '@vitest/runner';
|
|
6
4
|
import { File, Test as Test$1, Suite, TaskResultPack, Task, CancelReason, TaskCustom, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
7
5
|
import { RawSourceMap, FetchResult, ViteNodeResolveId, ModuleCacheMap, ViteNodeServerOptions } from 'vite-node';
|
|
6
|
+
import { SnapshotResult, SnapshotStateOptions, SnapshotState } from '@vitest/snapshot';
|
|
7
|
+
import { ExpectStatic } from '@vitest/expect';
|
|
8
8
|
import { ChainableFunction } from '@vitest/runner/utils';
|
|
9
9
|
import { ParsedStack, Awaitable as Awaitable$1, ErrorWithDiff, Arrayable as Arrayable$1 } from '@vitest/utils';
|
|
10
10
|
import { TaskResult, Bench, Options } from 'tinybench';
|
|
@@ -1235,7 +1235,7 @@ type CoverageOptions<T extends Provider = Provider> = T extends 'istanbul' ? ({
|
|
|
1235
1235
|
provider?: T;
|
|
1236
1236
|
} & (CoverageV8Options));
|
|
1237
1237
|
/** Fields that have default values. Internally these will always be defined. */
|
|
1238
|
-
type FieldsWithDefaultValues = 'enabled' | 'clean' | 'cleanOnRerun' | 'reportsDirectory' | 'exclude' | 'extension' | 'reportOnFailure';
|
|
1238
|
+
type FieldsWithDefaultValues = 'enabled' | 'clean' | 'cleanOnRerun' | 'reportsDirectory' | 'exclude' | 'extension' | 'reportOnFailure' | 'allowExternal';
|
|
1239
1239
|
type ResolvedCoverageOptions<T extends Provider = Provider> = CoverageOptions<T> & Required<Pick<CoverageOptions<T>, FieldsWithDefaultValues>> & {
|
|
1240
1240
|
reporter: CoverageReporterWithOptions[];
|
|
1241
1241
|
};
|
|
@@ -1351,6 +1351,12 @@ interface BaseCoverageOptions {
|
|
|
1351
1351
|
* @default false
|
|
1352
1352
|
*/
|
|
1353
1353
|
reportOnFailure?: boolean;
|
|
1354
|
+
/**
|
|
1355
|
+
* Collect coverage of files outside the project `root`.
|
|
1356
|
+
*
|
|
1357
|
+
* @default false
|
|
1358
|
+
*/
|
|
1359
|
+
allowExternal?: boolean;
|
|
1354
1360
|
}
|
|
1355
1361
|
interface CoverageIstanbulOptions extends BaseCoverageOptions {
|
|
1356
1362
|
/**
|
|
@@ -2284,4 +2290,4 @@ type Context = RootAndTarget & {
|
|
|
2284
2290
|
lastActivePath?: string;
|
|
2285
2291
|
};
|
|
2286
2292
|
|
|
2287
|
-
export { ResolveIdFunction as $, AfterSuiteRunMeta as A, BaseCoverageOptions as B, CoverageOptions as C, VitestPool as D, Environment as E, FakeTimerInstallOpts as F, CSSModuleScopeStrategy as G, HappyDOMOptions as H, ApiConfig as I, JSDOMOptions as J, EnvironmentOptions as K, DepsOptimizationOptions as L, MockFactory as M, TransformModePatterns as N, InlineConfig as O, ProjectConfig as P, TypecheckConfig as Q, ResolvedConfig as R, RunnerRPC as S, TestSequencer as T, UserConfig as U, VitestRunMode as V, WorkspaceSpec as W, ContextTestEnvironment as X, ResolvedTestEnvironment as Y, ContextRPC as Z, WorkerContext as _, CoverageProvider as a, WorkerRPC as a0, Awaitable as a1, Nullable as a2, Arrayable as a3, ArgumentsType$1 as a4, MutableArray as a5, Constructable as a6, ModuleCache as a7, EnvironmentReturn as a8, VmEnvironmentReturn as a9, OnServerRestartHandler as aa, ReportContext as ab, CoverageReporter as ac, CoverageIstanbulOptions as ad, CustomProviderOptions as ae, BenchmarkUserOptions as af, Benchmark as ag, BenchmarkResult as ah, BenchFunction as ai, CoverageProviderModule as b, ResolvedCoverageOptions as c, CoverageV8Options as d, Vitest as e, WorkspaceProject as f, TestSequencerConstructor as g, PendingSuiteMock as h, WorkerGlobalState as i, MockMap as j, RuntimeRPC as k, BenchmarkAPI as l, MockFactoryWithHelper as m, RuntimeConfig as n, UserConsoleLog as o, ModuleGraphData as p, Reporter as q, RawErrsMap as r, startVitest as s, TscErrorInfo as t, CollectLineNumbers as u, CollectLines as v, RootAndTarget as w, Context as x, BuiltinEnvironment as y, VitestEnvironment as z };
|
|
2293
|
+
export { ResolveIdFunction as $, AfterSuiteRunMeta as A, BaseCoverageOptions as B, CoverageOptions as C, VitestPool as D, Environment as E, FakeTimerInstallOpts as F, CSSModuleScopeStrategy as G, HappyDOMOptions as H, ApiConfig as I, JSDOMOptions as J, EnvironmentOptions as K, DepsOptimizationOptions as L, MockFactory as M, TransformModePatterns as N, InlineConfig as O, ProjectConfig as P, TypecheckConfig as Q, ResolvedConfig as R, RunnerRPC as S, TestSequencer as T, UserConfig as U, VitestRunMode as V, WorkspaceSpec as W, ContextTestEnvironment as X, ResolvedTestEnvironment as Y, ContextRPC as Z, WorkerContext as _, CoverageProvider as a, WorkerRPC as a0, Awaitable as a1, Nullable as a2, Arrayable as a3, ArgumentsType$1 as a4, MutableArray as a5, Constructable as a6, ModuleCache as a7, EnvironmentReturn as a8, VmEnvironmentReturn as a9, OnServerRestartHandler as aa, ReportContext as ab, CoverageReporter as ac, CoverageIstanbulOptions as ad, CustomProviderOptions as ae, BenchmarkUserOptions as af, Benchmark as ag, BenchmarkResult as ah, BenchFunction as ai, DefaultReporter as aj, BasicReporter as ak, DotReporter as al, JsonReporter$1 as am, VerboseReporter as an, TapReporter as ao, JUnitReporter as ap, TapFlatReporter as aq, HangingProcessReporter as ar, BaseReporter as as, ReportersMap as at, BuiltinReporters as au, BenchmarkReportsMap as av, BenchmarkBuiltinReporters as aw, CoverageProviderModule as b, ResolvedCoverageOptions as c, CoverageV8Options as d, Vitest as e, WorkspaceProject as f, TestSequencerConstructor as g, PendingSuiteMock as h, WorkerGlobalState as i, MockMap as j, RuntimeRPC as k, BenchmarkAPI as l, MockFactoryWithHelper as m, RuntimeConfig as n, UserConsoleLog as o, ModuleGraphData as p, Reporter as q, RawErrsMap as r, startVitest as s, TscErrorInfo as t, CollectLineNumbers as u, CollectLines as v, RootAndTarget as w, Context as x, BuiltinEnvironment as y, VitestEnvironment as z };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { as as BaseReporter, ak as BasicReporter, aw as BenchmarkBuiltinReporters, av as BenchmarkReportsMap, au as BuiltinReporters, aj as DefaultReporter, al as DotReporter, ar as HangingProcessReporter, ap as JUnitReporter, am as JsonReporter, q as Reporter, at as ReportersMap, aq as TapFlatReporter, ao as TapReporter, an as VerboseReporter } from './reporters-2ff87305.js';
|
|
2
|
+
import 'vite';
|
|
3
|
+
import '@vitest/runner';
|
|
4
|
+
import 'vite-node';
|
|
5
|
+
import '@vitest/snapshot';
|
|
6
|
+
import '@vitest/expect';
|
|
7
|
+
import '@vitest/runner/utils';
|
|
8
|
+
import '@vitest/utils';
|
|
9
|
+
import 'tinybench';
|
|
10
|
+
import 'vite-node/client';
|
|
11
|
+
import '@vitest/snapshot/manager';
|
|
12
|
+
import 'vite-node/server';
|
|
13
|
+
import 'node:worker_threads';
|
|
14
|
+
import 'rollup';
|
|
15
|
+
import 'node:fs';
|
|
16
|
+
import 'chai';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { f as BasicReporter, B as BenchmarkReportsMap, D as DefaultReporter, g as DotReporter, H as HangingProcessReporter, h as JUnitReporter, J as JsonReporter, R as ReportersMap, i as TapFlatReporter, T as TapReporter, V as VerboseReporter } from './vendor-reporters.f6975b8d.js';
|
|
2
|
+
import 'node:perf_hooks';
|
|
3
|
+
import 'picocolors';
|
|
4
|
+
import './vendor-index.29282562.js';
|
|
5
|
+
import 'pathe';
|
|
6
|
+
import 'std-env';
|
|
7
|
+
import '@vitest/runner/utils';
|
|
8
|
+
import '@vitest/utils';
|
|
9
|
+
import './vendor-global.97e4527c.js';
|
|
10
|
+
import './vendor-base.9c08bbd0.js';
|
|
11
|
+
import './vendor-tasks.f9d75aed.js';
|
|
12
|
+
import './vendor-_commonjsHelpers.7d1333e8.js';
|
|
13
|
+
import 'node:fs';
|
|
14
|
+
import '@vitest/utils/source-map';
|
|
15
|
+
import 'node:os';
|
|
16
|
+
import 'node:module';
|
package/dist/runners.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VitestRunner, VitestRunnerImportSource, Suite, Test, CancelReason, TestContext } from '@vitest/runner';
|
|
2
|
-
import { R as ResolvedConfig } from './
|
|
3
|
-
import '@vitest/snapshot';
|
|
4
|
-
import '@vitest/expect';
|
|
2
|
+
import { R as ResolvedConfig } from './reporters-2ff87305.js';
|
|
5
3
|
import 'vite';
|
|
6
4
|
import 'vite-node';
|
|
5
|
+
import '@vitest/snapshot';
|
|
6
|
+
import '@vitest/expect';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'tinybench';
|
package/dist/runners.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setState, GLOBAL_EXPECT, getState } from '@vitest/expect';
|
|
2
|
-
import { g as getSnapshotClient, c as createExpect, v as vi, a as getBenchOptions, b as getBenchFn } from './vendor-vi.
|
|
3
|
-
import './vendor-index.
|
|
2
|
+
import { g as getSnapshotClient, c as createExpect, v as vi, a as getBenchOptions, b as getBenchFn } from './vendor-vi.597d9e06.js';
|
|
3
|
+
import './vendor-index.29282562.js';
|
|
4
4
|
import { a as rpc } from './vendor-rpc.cbd8e972.js';
|
|
5
5
|
import { g as getFullName } from './vendor-tasks.f9d75aed.js';
|
|
6
6
|
import { g as getWorkerState } from './vendor-global.97e4527c.js';
|
|
@@ -265,6 +265,15 @@ const LIVING_KEYS = [
|
|
|
265
265
|
"Headers",
|
|
266
266
|
"AbortController",
|
|
267
267
|
"AbortSignal",
|
|
268
|
+
"Uint8Array",
|
|
269
|
+
"Uint16Array",
|
|
270
|
+
"Uint32Array",
|
|
271
|
+
"Uint8ClampedArray",
|
|
272
|
+
"Int8Array",
|
|
273
|
+
"Int16Array",
|
|
274
|
+
"Int32Array",
|
|
275
|
+
"Float32Array",
|
|
276
|
+
"Float64Array",
|
|
268
277
|
"ArrayBuffer",
|
|
269
278
|
"DOMRectReadOnly",
|
|
270
279
|
"DOMRect",
|
|
@@ -464,7 +473,6 @@ var jsdom = {
|
|
|
464
473
|
);
|
|
465
474
|
const clearWindowErrors = catchWindowErrors(dom.window);
|
|
466
475
|
dom.window.Buffer = Buffer;
|
|
467
|
-
dom.window.Uint8Array = Uint8Array;
|
|
468
476
|
if (typeof structuredClone !== "undefined" && !dom.window.structuredClone)
|
|
469
477
|
dom.window.structuredClone = structuredClone;
|
|
470
478
|
return {
|
|
@@ -535,15 +543,14 @@ var happy = {
|
|
|
535
543
|
url: happyDOM.url || "http://localhost:3000"
|
|
536
544
|
});
|
|
537
545
|
win.Buffer = Buffer;
|
|
538
|
-
win.Uint8Array = Uint8Array;
|
|
539
546
|
if (typeof structuredClone !== "undefined" && !win.structuredClone)
|
|
540
547
|
win.structuredClone = structuredClone;
|
|
541
548
|
return {
|
|
542
549
|
getVmContext() {
|
|
543
550
|
return win;
|
|
544
551
|
},
|
|
545
|
-
teardown() {
|
|
546
|
-
win.happyDOM.cancelAsync();
|
|
552
|
+
async teardown() {
|
|
553
|
+
await win.happyDOM.cancelAsync();
|
|
547
554
|
}
|
|
548
555
|
};
|
|
549
556
|
},
|
|
@@ -590,6 +597,10 @@ var edge = {
|
|
|
590
597
|
extend: (context) => {
|
|
591
598
|
context.global = context;
|
|
592
599
|
context.Buffer = Buffer;
|
|
600
|
+
KEYS.forEach((key) => {
|
|
601
|
+
if (key in global)
|
|
602
|
+
context[key] = global[key];
|
|
603
|
+
});
|
|
593
604
|
return context;
|
|
594
605
|
}
|
|
595
606
|
});
|
|
@@ -317,11 +317,13 @@ ${c.green(`vi.mock("${mockpath}", async () => {
|
|
|
317
317
|
return exports;
|
|
318
318
|
}
|
|
319
319
|
if (typeof mock === "function" && !callstack.includes(mockPath) && !callstack.includes(url)) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
320
|
+
try {
|
|
321
|
+
callstack.push(mockPath);
|
|
322
|
+
return await this.callFunctionMock(mockPath, mock);
|
|
323
|
+
} finally {
|
|
324
|
+
const indexMock = callstack.indexOf(mockPath);
|
|
325
|
+
callstack.splice(indexMock, 1);
|
|
326
|
+
}
|
|
325
327
|
}
|
|
326
328
|
if (typeof mock === "string" && !callstack.includes(mock))
|
|
327
329
|
return mock;
|
|
@@ -736,7 +738,7 @@ class ViteExecutor {
|
|
|
736
738
|
return cached;
|
|
737
739
|
const result = await this.options.transform(fileUrl, "web");
|
|
738
740
|
if (!result.code)
|
|
739
|
-
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file
|
|
741
|
+
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file exist?`);
|
|
740
742
|
return this.esm.createEsModule(fileUrl, result.code);
|
|
741
743
|
}
|
|
742
744
|
createViteClientModule() {
|
|
@@ -23,4 +23,4 @@ function removeUndefinedValues(obj) {
|
|
|
23
23
|
return obj;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export { isWindows as a, isNode as b, relativePath as c, isRunningInBenchmark as i, removeUndefinedValues as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
2
|
-
import { e as bench, c as createExpect, d as globalExpect, v as vi, f as vitest } from './vendor-vi.
|
|
2
|
+
import { e as bench, c as createExpect, d as globalExpect, v as vi, f as vitest } from './vendor-vi.597d9e06.js';
|
|
3
3
|
import { i as isFirstRun, r as runOnce } from './vendor-run-once.3e5ef7d7.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
import { assert, should } from 'chai';
|