vitest 2.0.0-beta.11 → 2.0.0-beta.13
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 +0 -21
- package/dist/browser.d.ts +3 -2
- package/dist/browser.js +2 -2
- package/dist/chunks/browser-creator.DSqYDthP.js +673 -0
- package/dist/chunks/{environments-node.39w4gmlF.js → environments-node.XE5FbRPQ.js} +1 -1
- package/dist/chunks/{integrations-globals.CC2ed6Py.js → integrations-globals.CzYWb38r.js} +6 -6
- package/dist/chunks/{runtime-console.Ckl0vEQr.js → runtime-console.O41g23Zj.js} +1 -1
- package/dist/chunks/{runtime-runBaseTests.BXW_BJeO.js → runtime-runBaseTests.DX3h28Mp.js} +15 -11
- package/dist/cli.js +2 -2
- package/dist/config.cjs +6 -4
- package/dist/config.d.ts +2 -1
- package/dist/config.js +6 -4
- package/dist/coverage.d.ts +4 -2
- package/dist/coverage.js +3 -2
- package/dist/environments.d.ts +2 -1
- package/dist/execute.d.ts +4 -3
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +6 -6
- package/dist/node.d.ts +19 -5
- package/dist/node.js +15 -14
- package/dist/{reporters-fiIq_dT9.d.ts → reporters-DrywOHjt.d.ts} +73 -23
- package/dist/reporters.d.ts +2 -1
- package/dist/reporters.js +5 -5
- package/dist/runners.d.ts +3 -1
- package/dist/runners.js +5 -4
- package/dist/snapshot.js +2 -2
- package/dist/{suite-D4aoU9rI.d.ts → suite-CrOPuDIk.d.ts} +1 -1
- package/dist/suite.d.ts +3 -2
- package/dist/suite.js +3 -3
- package/dist/vendor/{base.C2DbLEfT.js → base.CdA1i5tB.js} +4 -3
- package/dist/vendor/{benchmark.CMp8QfyL.js → benchmark.B6pblCp2.js} +1 -1
- package/dist/vendor/{cac.BcJW7n2j.js → cac.CpoEMnGk.js} +71 -14
- package/dist/vendor/{cli-api.C8t8m4__.js → cli-api.CXFLjKVN.js} +400 -6675
- package/dist/vendor/{constants.BWsVtsAj.js → constants.CsnA4eRy.js} +1 -2
- package/dist/vendor/env.2ltrQNq0.js +8 -0
- package/dist/vendor/{execute.T3gg2ZK6.js → execute.Dx503nGn.js} +12 -4
- package/dist/vendor/{index.BC5zhX9y.js → index.3x3MdmUV.js} +139 -82
- package/dist/vendor/{index.C9Thslzw.js → index.BJmtb_7W.js} +1 -1
- package/dist/vendor/{index.-dbR4KUi.js → index.CROIsoiT.js} +2 -2
- package/dist/vendor/index.D6GZqexG.js +6575 -0
- package/dist/vendor/{index.CQJ2m700.js → index.Hqvcg1pf.js} +2 -2
- package/dist/vendor/{setup-common.uqZOEWuR.js → setup-common.yHaxjRhz.js} +1 -1
- package/dist/vendor/{utils.DSO2UK15.js → utils.BVMrsl6E.js} +15 -5
- package/dist/vendor/{vi.BPjl8cAZ.js → vi.DXACdGTu.js} +1 -1
- package/dist/vendor/{vm.CycSoHnJ.js → vm.BrDS6p7h.js} +8 -6
- package/dist/worker.js +11 -4
- package/dist/workers/forks.js +10 -4
- package/dist/workers/runVmTests.js +14 -10
- package/dist/workers/threads.js +6 -3
- package/dist/workers/vmForks.js +12 -6
- package/dist/workers/vmThreads.js +8 -5
- package/dist/workers.d.ts +7 -4
- package/dist/workers.js +6 -6
- package/package.json +12 -12
- package/dist/vendor/env.bmJgw1qP.js +0 -7
|
@@ -6,7 +6,7 @@ import { R as RealDate } from '../vendor/date.W2xKR2qe.js';
|
|
|
6
6
|
import 'pathe';
|
|
7
7
|
import '@vitest/runner/utils';
|
|
8
8
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
9
|
-
import '../vendor/env.
|
|
9
|
+
import '../vendor/env.2ltrQNq0.js';
|
|
10
10
|
import 'std-env';
|
|
11
11
|
|
|
12
12
|
const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
|
-
import { startTests } from '@vitest/runner';
|
|
2
|
+
import { startTests, collectTests } from '@vitest/runner';
|
|
3
3
|
import 'pathe';
|
|
4
4
|
import '@vitest/runner/utils';
|
|
5
5
|
import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
|
|
6
6
|
import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
|
|
7
|
-
import '../vendor/env.
|
|
8
|
-
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.
|
|
7
|
+
import '../vendor/env.2ltrQNq0.js';
|
|
8
|
+
import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.DXACdGTu.js';
|
|
9
9
|
import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.BhYSDdTT.js';
|
|
10
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index
|
|
10
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.CROIsoiT.js';
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import util from 'node:util';
|
|
13
13
|
import timers from 'node:timers';
|
|
14
14
|
import { isatty } from 'node:tty';
|
|
15
15
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
16
|
-
import { V as VitestIndex } from '../vendor/index.
|
|
17
|
-
import { s as setupCommonEnv } from '../vendor/setup-common.
|
|
16
|
+
import { V as VitestIndex } from '../vendor/index.Hqvcg1pf.js';
|
|
17
|
+
import { s as setupCommonEnv } from '../vendor/setup-common.yHaxjRhz.js';
|
|
18
18
|
import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
|
|
19
19
|
import 'std-env';
|
|
20
20
|
import 'chai';
|
|
@@ -31,8 +31,8 @@ import '../path.js';
|
|
|
31
31
|
import 'node:url';
|
|
32
32
|
import '../vendor/rpc.BGx7q_k2.js';
|
|
33
33
|
import '../vendor/index.BpSiYbpB.js';
|
|
34
|
-
import '../vendor/benchmark.
|
|
35
|
-
import '../vendor/index.
|
|
34
|
+
import '../vendor/benchmark.B6pblCp2.js';
|
|
35
|
+
import '../vendor/index.BJmtb_7W.js';
|
|
36
36
|
import '../vendor/run-once.Db8Hgq9X.js';
|
|
37
37
|
|
|
38
38
|
let globalSetup = false;
|
|
@@ -73,7 +73,7 @@ async function setupGlobalEnv(config, { environment }, executor) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
async function setupConsoleLogSpy() {
|
|
76
|
-
const { createCustomConsole } = await import('./runtime-console.
|
|
76
|
+
const { createCustomConsole } = await import('./runtime-console.O41g23Zj.js');
|
|
77
77
|
globalThis.console = createCustomConsole();
|
|
78
78
|
}
|
|
79
79
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -91,7 +91,7 @@ async function withEnv({ environment }, options, fn) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
async function run(files, config, environment, executor) {
|
|
94
|
+
async function run(method, files, config, environment, executor) {
|
|
95
95
|
const workerState = getWorkerState();
|
|
96
96
|
await setupGlobalEnv(config, environment, executor);
|
|
97
97
|
await startCoverageInsideWorker(config.coverage, executor);
|
|
@@ -120,7 +120,11 @@ async function run(files, config, environment, executor) {
|
|
|
120
120
|
resetModules(workerState.moduleCache, true);
|
|
121
121
|
}
|
|
122
122
|
workerState.filepath = file;
|
|
123
|
-
|
|
123
|
+
if (method === "run") {
|
|
124
|
+
await startTests([file], runner);
|
|
125
|
+
} else {
|
|
126
|
+
await collectTests([file], runner);
|
|
127
|
+
}
|
|
124
128
|
vi.resetConfig();
|
|
125
129
|
vi.restoreAllMocks();
|
|
126
130
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as createCLI } from './vendor/cac.
|
|
1
|
+
import { c as createCLI } from './vendor/cac.CpoEMnGk.js';
|
|
2
2
|
import 'pathe';
|
|
3
3
|
import 'events';
|
|
4
4
|
import 'picocolors';
|
|
5
5
|
import './vendor/base.CTYV4Gnz.js';
|
|
6
6
|
import '@vitest/utils';
|
|
7
|
-
import './vendor/constants.
|
|
7
|
+
import './vendor/constants.CsnA4eRy.js';
|
|
8
8
|
|
|
9
9
|
createCLI().parse();
|
package/dist/config.cjs
CHANGED
|
@@ -4,9 +4,10 @@ var os = require('node:os');
|
|
|
4
4
|
var stdEnv = require('std-env');
|
|
5
5
|
var vite = require('vite');
|
|
6
6
|
|
|
7
|
-
var _a$1;
|
|
7
|
+
var _a$1, _b$1;
|
|
8
8
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
9
|
-
|
|
9
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && ((_b$1 = process.versions) == null ? void 0 : _b$1.deno) !== void 0;
|
|
10
|
+
(isNode || isDeno) && process.platform === "win32";
|
|
10
11
|
|
|
11
12
|
const defaultBrowserPort = 63315;
|
|
12
13
|
const extraInlineDeps = [
|
|
@@ -30,6 +31,7 @@ const defaultExclude = [
|
|
|
30
31
|
const defaultCoverageExcludes = [
|
|
31
32
|
"coverage/**",
|
|
32
33
|
"dist/**",
|
|
34
|
+
"**/node_modules/**",
|
|
33
35
|
"**/[.]**",
|
|
34
36
|
"packages/*/test?(s)/**",
|
|
35
37
|
"**/*.d.ts",
|
|
@@ -39,9 +41,9 @@ const defaultCoverageExcludes = [
|
|
|
39
41
|
"cypress/**",
|
|
40
42
|
"test?(s)/**",
|
|
41
43
|
"test?(-*).?(c|m)[jt]s?(x)",
|
|
42
|
-
"**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)",
|
|
44
|
+
"**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)",
|
|
43
45
|
"**/__tests__/**",
|
|
44
|
-
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
46
|
+
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
|
|
45
47
|
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
46
48
|
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
|
|
47
49
|
];
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
|
|
2
|
-
export {
|
|
2
|
+
export { aO as UserConfigExport, aN as UserConfigFn, aL as UserConfigFnObject, aM as UserConfigFnPromise, aQ as UserProjectConfigExport, aP as UserProjectConfigFn, K as UserWorkspaceConfig, aV as configDefaults, aY as coverageConfigDefaults, aU as defaultBrowserPort, aX as defaultExclude, aW as defaultInclude, aR as defineConfig, aS as defineProject, aT as defineWorkspace, aZ as extraInlineDeps } from './reporters-DrywOHjt.js';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
5
5
|
import '@vitest/snapshot';
|
|
@@ -12,5 +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 '@vitest/utils/source-map';
|
|
15
16
|
import 'node:fs';
|
|
16
17
|
import 'chai';
|
package/dist/config.js
CHANGED
|
@@ -2,9 +2,10 @@ import os from 'node:os';
|
|
|
2
2
|
import { isCI } from 'std-env';
|
|
3
3
|
export { mergeConfig } from 'vite';
|
|
4
4
|
|
|
5
|
-
var _a$1;
|
|
5
|
+
var _a$1, _b$1;
|
|
6
6
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a$1 = process.versions) == null ? void 0 : _a$1.deno) && !globalThis.window;
|
|
7
|
-
|
|
7
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && ((_b$1 = process.versions) == null ? void 0 : _b$1.deno) !== void 0;
|
|
8
|
+
(isNode || isDeno) && process.platform === "win32";
|
|
8
9
|
|
|
9
10
|
const defaultBrowserPort = 63315;
|
|
10
11
|
const extraInlineDeps = [
|
|
@@ -28,6 +29,7 @@ const defaultExclude = [
|
|
|
28
29
|
const defaultCoverageExcludes = [
|
|
29
30
|
"coverage/**",
|
|
30
31
|
"dist/**",
|
|
32
|
+
"**/node_modules/**",
|
|
31
33
|
"**/[.]**",
|
|
32
34
|
"packages/*/test?(s)/**",
|
|
33
35
|
"**/*.d.ts",
|
|
@@ -37,9 +39,9 @@ const defaultCoverageExcludes = [
|
|
|
37
39
|
"cypress/**",
|
|
38
40
|
"test?(s)/**",
|
|
39
41
|
"test?(-*).?(c|m)[jt]s?(x)",
|
|
40
|
-
"**/*{.,-}{test,spec}?(-d).?(c|m)[jt]s?(x)",
|
|
42
|
+
"**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)",
|
|
41
43
|
"**/__tests__/**",
|
|
42
|
-
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
44
|
+
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*",
|
|
43
45
|
"**/vitest.{workspace,projects}.[jt]s?(on)",
|
|
44
46
|
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
|
|
45
47
|
];
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-
|
|
1
|
+
import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-DrywOHjt.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
@@ -12,6 +12,7 @@ import 'vite-node/client';
|
|
|
12
12
|
import '@vitest/snapshot/manager';
|
|
13
13
|
import 'vite-node/server';
|
|
14
14
|
import 'node:worker_threads';
|
|
15
|
+
import '@vitest/utils/source-map';
|
|
15
16
|
import 'node:fs';
|
|
16
17
|
import 'chai';
|
|
17
18
|
|
|
@@ -138,9 +139,10 @@ declare class BaseCoverageProvider {
|
|
|
138
139
|
/**
|
|
139
140
|
* Check collected coverage against configured thresholds. Sets exit code to 1 when thresholds not reached.
|
|
140
141
|
*/
|
|
141
|
-
checkThresholds({ thresholds: allThresholds, perFile, }: {
|
|
142
|
+
checkThresholds({ thresholds: allThresholds, perFile, onError, }: {
|
|
142
143
|
thresholds: ResolvedThreshold[];
|
|
143
144
|
perFile?: boolean;
|
|
145
|
+
onError: (error: string) => void;
|
|
144
146
|
}): void;
|
|
145
147
|
/**
|
|
146
148
|
* Constructs collected coverage and users' threshold options into separate sets
|
package/dist/coverage.js
CHANGED
|
@@ -63,7 +63,8 @@ class BaseCoverageProvider {
|
|
|
63
63
|
*/
|
|
64
64
|
checkThresholds({
|
|
65
65
|
thresholds: allThresholds,
|
|
66
|
-
perFile
|
|
66
|
+
perFile,
|
|
67
|
+
onError
|
|
67
68
|
}) {
|
|
68
69
|
for (const { coverageMap, thresholds, name } of allThresholds) {
|
|
69
70
|
if (thresholds.branches === void 0 && thresholds.functions === void 0 && thresholds.lines === void 0 && thresholds.statements === void 0) {
|
|
@@ -97,7 +98,7 @@ class BaseCoverageProvider {
|
|
|
97
98
|
"/"
|
|
98
99
|
)}`;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
onError(errorMessage);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Environment } from './reporters-
|
|
1
|
+
import { E as Environment } from './reporters-DrywOHjt.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import '@vitest/runner';
|
|
4
4
|
import 'vite-node';
|
|
@@ -12,6 +12,7 @@ import 'vite-node/client';
|
|
|
12
12
|
import '@vitest/snapshot/manager';
|
|
13
13
|
import 'vite-node/server';
|
|
14
14
|
import 'node:worker_threads';
|
|
15
|
+
import '@vitest/utils/source-map';
|
|
15
16
|
import 'node:fs';
|
|
16
17
|
import 'chai';
|
|
17
18
|
|
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 {
|
|
4
|
+
import { aI as PendingSuiteMock, aJ as MockFactory, e as RuntimeRPC, W as WorkerGlobalState, aK as MockMap } from './reporters-DrywOHjt.js';
|
|
5
5
|
import 'vite';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import '@vitest/snapshot';
|
|
@@ -13,6 +13,7 @@ import 'node:stream';
|
|
|
13
13
|
import '@vitest/snapshot/manager';
|
|
14
14
|
import 'vite-node/server';
|
|
15
15
|
import 'node:worker_threads';
|
|
16
|
+
import '@vitest/utils/source-map';
|
|
16
17
|
import 'node:fs';
|
|
17
18
|
import 'chai';
|
|
18
19
|
|
|
@@ -135,9 +136,9 @@ declare class VitestExecutor extends ViteNodeRunner {
|
|
|
135
136
|
private primitives;
|
|
136
137
|
constructor(options: ExecuteOptions);
|
|
137
138
|
protected getContextPrimitives(): {
|
|
138
|
-
Object:
|
|
139
|
+
Object: typeof Object;
|
|
139
140
|
Reflect: typeof Reflect;
|
|
140
|
-
Symbol:
|
|
141
|
+
Symbol: typeof Symbol;
|
|
141
142
|
};
|
|
142
143
|
get state(): WorkerGlobalState;
|
|
143
144
|
shouldResolveId(id: string, _importee?: string | undefined): boolean;
|
package/dist/execute.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TaskPopulated, File, TaskResultPack } from '@vitest/runner';
|
|
2
2
|
export { CancelReason, Custom, DoneCallback, ExtendedContext, File, HookCleanupCallback, HookListener, OnTestFailedHandler, RunMode, RuntimeContext, SequenceHooks, SequenceSetupFiles, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskContext, TaskCustomOptions, TaskMeta, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
3
|
-
export { b as bench } from './suite-
|
|
3
|
+
export { b as bench } from './suite-CrOPuDIk.js';
|
|
4
4
|
import { ExpectStatic } from '@vitest/expect';
|
|
5
|
-
export { Assertion, AsymmetricMatchersContaining, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
-
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig,
|
|
7
|
-
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy,
|
|
5
|
+
export { Assertion, AsymmetricMatchersContaining, ExpectPollOptions, ExpectStatic, JestAssertion } from '@vitest/expect';
|
|
6
|
+
import { F as FakeTimerInstallOpts, M as MockFactoryWithHelper, h as RuntimeConfig, i as ProvidedContext, R as ResolvedConfig, j as ModuleGraphData, k as Reporter, l as BirpcReturn } from './reporters-DrywOHjt.js';
|
|
7
|
+
export { Y as AfterSuiteRunMeta, A as ApiConfig, a1 as ArgumentsType, a0 as Arrayable, _ as Awaitable, B as BaseCoverageOptions, ah as BenchFunction, af as Benchmark, ai as BenchmarkAPI, ag as BenchmarkResult, ae as BenchmarkUserOptions, G as BrowserConfigOptions, z as BrowserScript, s as BuiltinEnvironment, t as CSSModuleScopeStrategy, n as CollectLineNumbers, o as CollectLines, a3 as Constructable, q as Context, f as ContextRPC, N as ContextTestEnvironment, ab as CoverageIstanbulOptions, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule, aa as CoverageReporter, ac as CoverageV8Options, ad as CustomProviderOptions, D as DepsOptimizationOptions, E as Environment, u as EnvironmentOptions, a5 as EnvironmentReturn, H as HappyDOMOptions, I as InlineConfig, J as JSDOMOptions, a4 as ModuleCache, a2 as MutableArray, $ as Nullable, a8 as OnServerRestartHandler, P as Pool, r as PoolOptions, y as ProjectConfig, m as RawErrsMap, a9 as ReportContext, X as ResolveIdFunction, a as ResolvedCoverageOptions, O as ResolvedTestEnvironment, p as RootAndTarget, L as RunnerRPC, e as RuntimeRPC, S as SerializableSpec, w as TransformModePatterns, T as TscErrorInfo, x as TypecheckConfig, U as UserConfig, a7 as UserConsoleLog, K as UserWorkspaceConfig, Q as Vitest, V as VitestEnvironment, v as VitestRunMode, a6 as VmEnvironmentReturn, g as WorkerContext, W as WorkerGlobalState, Z as WorkerRPC } from './reporters-DrywOHjt.js';
|
|
8
8
|
import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';
|
|
9
|
-
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject
|
|
9
|
+
export { Mock, MockContext, MockInstance, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';
|
|
10
10
|
export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';
|
|
11
11
|
export { DiffOptions } from '@vitest/utils/diff';
|
|
12
12
|
import { TransformResult } from 'vite';
|
|
@@ -22,6 +22,7 @@ import 'vite-node/client';
|
|
|
22
22
|
import '@vitest/snapshot/manager';
|
|
23
23
|
import 'vite-node/server';
|
|
24
24
|
import 'node:worker_threads';
|
|
25
|
+
import '@vitest/utils/source-map';
|
|
25
26
|
import 'node:fs';
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -1420,7 +1421,7 @@ declare function isWatchMode(): boolean;
|
|
|
1420
1421
|
* Gives access to injected context provided from the main thread.
|
|
1421
1422
|
* This usually returns a value provided by `globalSetup` or an external library.
|
|
1422
1423
|
*/
|
|
1423
|
-
declare function inject<T extends keyof ProvidedContext>(key: T): ProvidedContext[T];
|
|
1424
|
+
declare function inject<T extends keyof ProvidedContext & string>(key: T): ProvidedContext[T];
|
|
1424
1425
|
|
|
1425
1426
|
interface TransformResultWithSource extends TransformResult {
|
|
1426
1427
|
source?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
|
-
export { b as bench } from './vendor/benchmark.
|
|
2
|
+
export { b as bench } from './vendor/benchmark.B6pblCp2.js';
|
|
3
3
|
export { i as isFirstRun, a as runOnce } from './vendor/run-once.Db8Hgq9X.js';
|
|
4
|
-
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.
|
|
5
|
-
import { d as dist } from './vendor/index.
|
|
6
|
-
export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.
|
|
4
|
+
export { c as createExpect, a as expect, v as vi, b as vitest } from './vendor/vi.DXACdGTu.js';
|
|
5
|
+
import { d as dist } from './vendor/index.Hqvcg1pf.js';
|
|
6
|
+
export { b as assertType, g as getRunningMode, i as inject, a as isWatchMode } from './vendor/index.Hqvcg1pf.js';
|
|
7
7
|
import * as chai from 'chai';
|
|
8
8
|
export { chai };
|
|
9
9
|
export { assert, should } from 'chai';
|
|
10
10
|
import '@vitest/runner/utils';
|
|
11
11
|
import '@vitest/utils';
|
|
12
|
-
import './vendor/index.
|
|
12
|
+
import './vendor/index.BJmtb_7W.js';
|
|
13
13
|
import 'pathe';
|
|
14
14
|
import './vendor/global.7bFbnyXl.js';
|
|
15
|
-
import './vendor/env.
|
|
15
|
+
import './vendor/env.2ltrQNq0.js';
|
|
16
16
|
import 'std-env';
|
|
17
17
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
18
18
|
import '@vitest/expect';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig,
|
|
2
|
-
export {
|
|
1
|
+
import { v as VitestRunMode, U as UserConfig, aj as VitestOptions, Q as Vitest, R as ResolvedConfig, i as ProvidedContext, ak as WorkspaceProject, e as RuntimeRPC, A as ApiConfig, al as Logger, am as TestSequencer, an as WorkspaceSpec } from './reporters-DrywOHjt.js';
|
|
2
|
+
export { ay as BrowserBuiltinProvider, az as BrowserCommand, aA as BrowserCommandContext, aE as BrowserOrchestrator, at as BrowserProvider, as as BrowserProviderInitializationOptions, av as BrowserProviderModule, ax as BrowserProviderOptions, z as BrowserScript, aB as BrowserServer, aC as BrowserServerState, aD as BrowserServerStateContext, au as CDPSession, aH as HTMLOptions, aG as JUnitOptions, aF as JsonOptions, ao as ProcessPool, aw as ResolvedBrowserOptions, ar as TestSequencerConstructor, aq as VitestPackageInstaller, ap as getFilePoolName } from './reporters-DrywOHjt.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin, ResolvedConfig as ResolvedConfig$1 } from 'vite';
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
export { vite as Vite };
|
|
6
|
-
export { createServer, isFileServingAllowed } from 'vite';
|
|
6
|
+
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
7
|
import { Writable } from 'node:stream';
|
|
8
8
|
import createDebug from 'debug';
|
|
9
9
|
import '@vitest/runner';
|
|
@@ -17,6 +17,7 @@ import 'vite-node/client';
|
|
|
17
17
|
import '@vitest/snapshot/manager';
|
|
18
18
|
import 'vite-node/server';
|
|
19
19
|
import 'node:worker_threads';
|
|
20
|
+
import '@vitest/utils/source-map';
|
|
20
21
|
import 'node:fs';
|
|
21
22
|
import 'chai';
|
|
22
23
|
|
|
@@ -33,6 +34,10 @@ interface CliOptions extends UserConfig {
|
|
|
33
34
|
* Removes colors from the console output
|
|
34
35
|
*/
|
|
35
36
|
color?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Output collected tests as JSON or to a file
|
|
39
|
+
*/
|
|
40
|
+
json?: string | boolean;
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* Start Vitest programmatically
|
|
@@ -53,7 +58,7 @@ declare function registerConsoleShortcuts(ctx: Vitest, stdin: NodeJS.ReadStream
|
|
|
53
58
|
|
|
54
59
|
interface GlobalSetupContext {
|
|
55
60
|
config: ResolvedConfig;
|
|
56
|
-
provide: <T extends keyof ProvidedContext>(key: T, value: ProvidedContext[T]) => void;
|
|
61
|
+
provide: <T extends keyof ProvidedContext & string>(key: T, value: ProvidedContext[T]) => void;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
interface MethodsOptions {
|
|
@@ -68,6 +73,15 @@ declare function resolveFsAllow(projectRoot: string, rootConfigFile: string | fa
|
|
|
68
73
|
declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig>(options: Options, defaultPort: number): ApiConfig | undefined;
|
|
69
74
|
declare function resolveConfig(mode: VitestRunMode, options: UserConfig, viteConfig: ResolvedConfig$1, logger: Logger): ResolvedConfig;
|
|
70
75
|
|
|
76
|
+
declare class FilesNotFoundError extends Error {
|
|
77
|
+
code: string;
|
|
78
|
+
constructor(mode: 'test' | 'benchmark');
|
|
79
|
+
}
|
|
80
|
+
declare class GitNotFoundError extends Error {
|
|
81
|
+
code: string;
|
|
82
|
+
constructor();
|
|
83
|
+
}
|
|
84
|
+
|
|
71
85
|
declare const rootDir: string;
|
|
72
86
|
declare const distDir: string;
|
|
73
87
|
|
|
@@ -78,4 +92,4 @@ declare class BaseSequencer implements TestSequencer {
|
|
|
78
92
|
sort(files: WorkspaceSpec[]): Promise<WorkspaceSpec[]>;
|
|
79
93
|
}
|
|
80
94
|
|
|
81
|
-
export { BaseSequencer, type GlobalSetupContext, TestSequencer, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
|
95
|
+
export { BaseSequencer, GitNotFoundError, type GlobalSetupContext, TestSequencer, FilesNotFoundError as TestsNotFoundError, Vitest, VitestPlugin, WorkspaceProject, WorkspaceSpec, createDebugger, createMethodsRPC, createVitest, distDir, parseCLI, registerConsoleShortcuts, resolveApiServerConfig, resolveConfig, resolveFsAllow, rootDir, startVitest };
|
package/dist/node.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
export { b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.
|
|
2
|
-
export { p as parseCLI } from './vendor/cac.
|
|
1
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, V as VitestPlugin, a as createMethodsRPC, c as createVitest, g as getFilePoolName, r as registerConsoleShortcuts, e as resolveApiServerConfig, f as resolveConfig, d as resolveFsAllow, s as startVitest } from './vendor/cli-api.CXFLjKVN.js';
|
|
2
|
+
export { p as parseCLI } from './vendor/cac.CpoEMnGk.js';
|
|
3
3
|
import createDebug from 'debug';
|
|
4
4
|
export { distDir, rootDir } from './path.js';
|
|
5
|
-
export { e as BaseSequencer } from './vendor/index.
|
|
6
|
-
export { createServer, isFileServingAllowed } from 'vite';
|
|
5
|
+
export { e as BaseSequencer } from './vendor/index.3x3MdmUV.js';
|
|
6
|
+
export { createServer, isFileServingAllowed, parseAst, parseAstAsync } from 'vite';
|
|
7
|
+
import 'node:fs';
|
|
7
8
|
import 'pathe';
|
|
8
|
-
import './vendor/constants.BWsVtsAj.js';
|
|
9
9
|
import './vendor/coverage.BhYSDdTT.js';
|
|
10
10
|
import './vendor/index.D4nqnQWz.js';
|
|
11
11
|
import 'node:console';
|
|
12
|
+
import './vendor/index.D6GZqexG.js';
|
|
12
13
|
import 'node:path';
|
|
13
14
|
import 'node:url';
|
|
14
15
|
import 'node:process';
|
|
15
|
-
import 'node:fs';
|
|
16
|
-
import 'node:worker_threads';
|
|
17
16
|
import './vendor/_commonjsHelpers.BFTU3MAI.js';
|
|
17
|
+
import 'readline';
|
|
18
|
+
import 'events';
|
|
19
|
+
import './vendor/constants.CsnA4eRy.js';
|
|
20
|
+
import 'node:worker_threads';
|
|
18
21
|
import 'os';
|
|
19
22
|
import 'path';
|
|
20
23
|
import 'util';
|
|
21
24
|
import './vendor/index.BMmMjLIQ.js';
|
|
22
25
|
import 'stream';
|
|
23
|
-
import 'events';
|
|
24
26
|
import 'fs';
|
|
25
|
-
import 'picocolors';
|
|
26
27
|
import 'vite-node/client';
|
|
27
28
|
import '@vitest/snapshot/manager';
|
|
28
29
|
import 'vite-node/server';
|
|
29
30
|
import '@vitest/runner/utils';
|
|
30
31
|
import './vendor/base.CTYV4Gnz.js';
|
|
31
32
|
import '@vitest/utils';
|
|
32
|
-
import './vendor/env.
|
|
33
|
+
import './vendor/env.2ltrQNq0.js';
|
|
33
34
|
import 'std-env';
|
|
34
35
|
import './vendor/index.BpSiYbpB.js';
|
|
35
36
|
import 'zlib';
|
|
@@ -50,17 +51,17 @@ import 'node:fs/promises';
|
|
|
50
51
|
import 'node:module';
|
|
51
52
|
import 'node:assert';
|
|
52
53
|
import 'node:util';
|
|
54
|
+
import 'picocolors';
|
|
53
55
|
import 'vite-node/utils';
|
|
54
56
|
import 'magic-string';
|
|
55
57
|
import '@vitest/utils/ast';
|
|
56
|
-
import './vendor/index.
|
|
58
|
+
import './vendor/index.BJmtb_7W.js';
|
|
57
59
|
import './vendor/global.7bFbnyXl.js';
|
|
58
60
|
import 'node:readline';
|
|
59
|
-
import '
|
|
60
|
-
import './vendor/utils.DSO2UK15.js';
|
|
61
|
+
import './vendor/utils.BVMrsl6E.js';
|
|
61
62
|
import './vendor/tasks.DhVtQBtW.js';
|
|
62
63
|
import 'node:perf_hooks';
|
|
63
|
-
import './chunks/runtime-console.
|
|
64
|
+
import './chunks/runtime-console.O41g23Zj.js';
|
|
64
65
|
import 'node:stream';
|
|
65
66
|
import './vendor/date.W2xKR2qe.js';
|
|
66
67
|
import 'execa';
|