vitest 3.1.0-beta.1 → 3.1.0
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 +29 -0
- package/dist/browser.js +4 -4
- package/dist/chunks/base.bV8rwssx.js +41 -0
- package/dist/chunks/benchmark.BKUatJGy.js +39 -0
- package/dist/chunks/cac.1WcTh-zl.js +1529 -0
- package/dist/chunks/{cli-api.BwkkJsRe.js → cli-api.2yb7XCwB.js} +4640 -5072
- package/dist/chunks/console.D6t261w0.js +173 -0
- package/dist/chunks/constants.BZZyIeIE.js +43 -0
- package/dist/chunks/coverage.0iPg4Wrz.js +33 -0
- package/dist/chunks/{coverage.gV8doR2Y.js → coverage.SfnlalVs.js} +2424 -2482
- package/dist/chunks/creator.CuL7xDWI.js +705 -0
- package/dist/chunks/date.CDOsz-HY.js +53 -0
- package/dist/chunks/defaults.DmfNPoe5.js +114 -0
- package/dist/chunks/{env.D4Lgay0q.js → env.Dq0hM4Xv.js} +1 -1
- package/dist/chunks/execute.CwmnH2oH.js +791 -0
- package/dist/chunks/git.DXfdBEfR.js +74 -0
- package/dist/chunks/{globals.BEpDe-k3.js → globals.DCbUWjip.js} +10 -10
- package/dist/chunks/{index.D7Ny8f_s.js → index.BDobFbcz.js} +6 -7
- package/dist/chunks/index.CwHmn5H5.js +2422 -0
- package/dist/chunks/index.DFXFpH3w.js +607 -0
- package/dist/chunks/index.VfYQ6MXY.js +104 -0
- package/dist/chunks/inspector.DbDkSkFn.js +54 -0
- package/dist/chunks/node.IqGoMrm4.js +15 -0
- package/dist/chunks/{reporters.d.r7poTZjA.d.ts → reporters.d.CfRkRKN2.d.ts} +52 -20
- package/dist/chunks/rpc.DGgL5dw7.js +92 -0
- package/dist/chunks/run-once.I7PpBOk1.js +47 -0
- package/dist/chunks/runBaseTests.CqmKSG99.js +134 -0
- package/dist/chunks/setup-common.DEGDGBiA.js +88 -0
- package/dist/chunks/{typechecker.BlF3eHsb.js → typechecker.CG0zmr19.js} +620 -622
- package/dist/chunks/utils.BfxieIyZ.js +66 -0
- package/dist/chunks/utils.CtocqOoE.js +72 -0
- package/dist/chunks/utils.Lot3J_8U.js +194 -0
- package/dist/chunks/{vi.nSCvwQ7l.js → vi.B-PuvDzu.js} +878 -1019
- package/dist/chunks/vite.d.4pkSbgmp.d.ts +23 -0
- package/dist/chunks/vm.Lp7mPCVW.js +796 -0
- package/dist/cli.js +2 -2
- package/dist/config.cjs +97 -103
- package/dist/config.d.ts +6 -4
- package/dist/config.js +6 -6
- package/dist/coverage.d.ts +2 -1
- package/dist/coverage.js +7 -7
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +0 -2
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +6 -6
- package/dist/node.d.ts +17 -6
- package/dist/node.js +36 -45
- package/dist/path.js +1 -4
- package/dist/reporters.d.ts +2 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.js +231 -267
- package/dist/snapshot.js +2 -2
- package/dist/suite.js +2 -2
- package/dist/worker.js +98 -114
- package/dist/workers/forks.js +22 -22
- package/dist/workers/runVmTests.js +61 -66
- package/dist/workers/threads.js +13 -13
- package/dist/workers/vmForks.js +24 -24
- package/dist/workers/vmThreads.js +15 -15
- package/dist/workers.d.ts +2 -1
- package/dist/workers.js +10 -10
- package/package.json +17 -17
- package/dist/chunks/base.DV59CbtV.js +0 -45
- package/dist/chunks/benchmark.DL72EVN-.js +0 -40
- package/dist/chunks/cac.BjmXy7OV.js +0 -1664
- package/dist/chunks/console.CN7AiMGV.js +0 -179
- package/dist/chunks/constants.DTYd6dNH.js +0 -46
- package/dist/chunks/coverage.A3sS5-Wm.js +0 -40
- package/dist/chunks/creator.BsBnpTzI.js +0 -670
- package/dist/chunks/date.W2xKR2qe.js +0 -53
- package/dist/chunks/defaults.C2Ndd9wx.js +0 -119
- package/dist/chunks/execute.eDH0aFFd.js +0 -839
- package/dist/chunks/git.B5SDxu-n.js +0 -69
- package/dist/chunks/index.DOyx6FYJ.js +0 -2551
- package/dist/chunks/index.K90BXFOx.js +0 -658
- package/dist/chunks/index.uXkkC4xl.js +0 -111
- package/dist/chunks/inspector.DKLceBVD.js +0 -54
- package/dist/chunks/node.AKq966Jp.js +0 -15
- package/dist/chunks/rpc.TVf73xOu.js +0 -102
- package/dist/chunks/run-once.2ogXb3JV.js +0 -28
- package/dist/chunks/runBaseTests.BVrL_ow3.js +0 -142
- package/dist/chunks/setup-common.CPvtqi8q.js +0 -96
- package/dist/chunks/utils.C8RiOc4B.js +0 -77
- package/dist/chunks/utils.Cn0zI1t3.js +0 -68
- package/dist/chunks/utils.bLM2atbD.js +0 -198
- package/dist/chunks/vite.d.Fvq-NZoa.d.ts +0 -11
- package/dist/chunks/vm.jEFQDlX_.js +0 -852
package/dist/node.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { resolveConfig as resolveConfig$1, mergeConfig, createServer as createServer$1 } from 'vite';
|
|
2
2
|
export { esbuildVersion, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
3
|
-
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.
|
|
4
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
5
|
-
export { p as parseCLI } from './chunks/cac.
|
|
6
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
7
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
3
|
+
import { V as Vitest, a as VitestPlugin, T as TestModule } from './chunks/cli-api.2yb7XCwB.js';
|
|
4
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.2yb7XCwB.js';
|
|
5
|
+
export { p as parseCLI } from './chunks/cac.1WcTh-zl.js';
|
|
6
|
+
import { r as resolveConfig$2 } from './chunks/coverage.SfnlalVs.js';
|
|
7
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.SfnlalVs.js';
|
|
8
8
|
import { slash } from '@vitest/utils';
|
|
9
9
|
import { f as findUp } from './chunks/index.DBIGubLC.js';
|
|
10
10
|
import { resolve } from 'pathe';
|
|
11
|
-
import { c as configFiles } from './chunks/constants.
|
|
11
|
+
import { c as configFiles } from './chunks/constants.BZZyIeIE.js';
|
|
12
12
|
export { distDir, rootDir } from './path.js';
|
|
13
13
|
import createDebug from 'debug';
|
|
14
14
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
15
15
|
import 'node:fs';
|
|
16
|
-
import './chunks/coverage.
|
|
16
|
+
import './chunks/coverage.0iPg4Wrz.js';
|
|
17
17
|
import 'node:path';
|
|
18
18
|
import '@vitest/snapshot/manager';
|
|
19
19
|
import 'vite-node/client';
|
|
20
20
|
import 'vite-node/server';
|
|
21
21
|
import './chunks/index.68735LiX.js';
|
|
22
|
-
import './chunks/index.
|
|
22
|
+
import './chunks/index.CwHmn5H5.js';
|
|
23
23
|
import 'tinyrainbow';
|
|
24
|
-
import './chunks/utils.
|
|
24
|
+
import './chunks/utils.Lot3J_8U.js';
|
|
25
25
|
import 'node:util';
|
|
26
26
|
import 'node:perf_hooks';
|
|
27
27
|
import '@vitest/utils/source-map';
|
|
28
|
-
import './chunks/env.
|
|
28
|
+
import './chunks/env.Dq0hM4Xv.js';
|
|
29
29
|
import 'std-env';
|
|
30
|
-
import './chunks/typechecker.
|
|
30
|
+
import './chunks/typechecker.CG0zmr19.js';
|
|
31
31
|
import 'node:fs/promises';
|
|
32
32
|
import 'tinyexec';
|
|
33
33
|
import 'node:os';
|
|
@@ -51,7 +51,7 @@ import 'node:crypto';
|
|
|
51
51
|
import 'path';
|
|
52
52
|
import 'vite-node/utils';
|
|
53
53
|
import '@vitest/mocker/node';
|
|
54
|
-
import './chunks/defaults.
|
|
54
|
+
import './chunks/defaults.DmfNPoe5.js';
|
|
55
55
|
import 'magic-string';
|
|
56
56
|
import 'node:assert';
|
|
57
57
|
import '@vitest/utils/error';
|
|
@@ -66,47 +66,38 @@ import 'node:worker_threads';
|
|
|
66
66
|
import 'readline';
|
|
67
67
|
|
|
68
68
|
async function resolveConfig(options = {}, viteOverrides = {}) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"serve"
|
|
86
|
-
);
|
|
87
|
-
const updatedOptions = Reflect.get(config, "_vitest");
|
|
88
|
-
const vitestConfig = resolveConfig$2(
|
|
89
|
-
vitest,
|
|
90
|
-
updatedOptions,
|
|
91
|
-
config
|
|
92
|
-
);
|
|
93
|
-
await vitest.close();
|
|
94
|
-
return {
|
|
95
|
-
viteConfig: config,
|
|
96
|
-
vitestConfig
|
|
97
|
-
};
|
|
69
|
+
const root = slash(resolve(options.root || process.cwd()));
|
|
70
|
+
const configPath = options.config === false ? false : options.config ? resolve(root, options.config) : await findUp(configFiles, { cwd: root });
|
|
71
|
+
options.config = configPath;
|
|
72
|
+
const vitest = new Vitest("test");
|
|
73
|
+
const config = await resolveConfig$1(mergeConfig({
|
|
74
|
+
configFile: configPath,
|
|
75
|
+
mode: options.mode || "test",
|
|
76
|
+
plugins: [await VitestPlugin(options, vitest)]
|
|
77
|
+
}, mergeConfig(viteOverrides, { root: options.root })), "serve");
|
|
78
|
+
const updatedOptions = Reflect.get(config, "_vitest");
|
|
79
|
+
const vitestConfig = resolveConfig$2(vitest, updatedOptions, config);
|
|
80
|
+
await vitest.close();
|
|
81
|
+
return {
|
|
82
|
+
viteConfig: config,
|
|
83
|
+
vitestConfig
|
|
84
|
+
};
|
|
98
85
|
}
|
|
99
86
|
|
|
100
87
|
function createDebugger(namespace) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
88
|
+
const debug = createDebug(namespace);
|
|
89
|
+
if (debug.enabled) {
|
|
90
|
+
return debug;
|
|
91
|
+
}
|
|
105
92
|
}
|
|
106
93
|
|
|
107
94
|
const version = Vitest.version;
|
|
95
|
+
/** @deprecated use `createViteServer` instead */
|
|
108
96
|
const createServer = createServer$1;
|
|
109
97
|
const createViteServer = createServer$1;
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated Use `TestModule` instead
|
|
100
|
+
*/
|
|
110
101
|
const TestFile = TestModule;
|
|
111
102
|
|
|
112
103
|
export { TestFile, VitestPlugin, createDebugger, createServer, createViteServer, resolveConfig, version };
|
package/dist/path.js
CHANGED
|
@@ -2,9 +2,6 @@ import { resolve } from 'node:path';
|
|
|
2
2
|
import url from 'node:url';
|
|
3
3
|
|
|
4
4
|
const rootDir = resolve(url.fileURLToPath(import.meta.url), "../../");
|
|
5
|
-
const distDir = resolve(
|
|
6
|
-
url.fileURLToPath(import.meta.url),
|
|
7
|
-
"../../dist"
|
|
8
|
-
);
|
|
5
|
+
const distDir = resolve(url.fileURLToPath(import.meta.url), "../../dist");
|
|
9
6
|
|
|
10
7
|
export { distDir, rootDir };
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aO as BaseReporter, aA as BasicReporter, aP as BenchmarkBuiltinReporters, aB as BenchmarkReporter, aC as BenchmarkReportsMap, aQ as BuiltinReporterOptions, aR as BuiltinReporters, aD as DefaultReporter, aE as DotReporter, aF as GithubActionsReporter, aG as HangingProcessReporter, aI as JUnitReporter, aS as JsonAssertionResult, aH as JsonReporter, aT as JsonTestResult, aU as JsonTestResults, ay as ReportedHookContext, n as Reporter, aJ as ReportersMap, aK as TapFlatReporter, aL as TapReporter, az as TestRunEndReason, aM as VerboseBenchmarkReporter, aN as VerboseReporter } from './chunks/reporters.d.CfRkRKN2.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.d.C8UItCbf.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import 'vite';
|
|
7
7
|
import 'node:console';
|
|
8
|
+
import '@vitest/mocker';
|
|
8
9
|
import '@vitest/utils/source-map';
|
|
9
10
|
import './chunks/config.d.DevWltVl.js';
|
|
10
11
|
import '@vitest/pretty-format';
|
package/dist/reporters.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.
|
|
1
|
+
export { B as BasicReporter, a as BenchmarkReporter, b as BenchmarkReportsMap, D as DefaultReporter, c as DotReporter, G as GithubActionsReporter, H as HangingProcessReporter, d as JUnitReporter, J as JsonReporter, R as ReportersMap, T as TapFlatReporter, e as TapReporter, V as VerboseBenchmarkReporter, f as VerboseReporter } from './chunks/index.CwHmn5H5.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import '@vitest/runner/utils';
|
|
4
4
|
import 'pathe';
|
|
5
5
|
import 'tinyrainbow';
|
|
6
|
-
import './chunks/utils.
|
|
6
|
+
import './chunks/utils.Lot3J_8U.js';
|
|
7
7
|
import 'node:util';
|
|
8
8
|
import '@vitest/utils';
|
|
9
9
|
import 'node:perf_hooks';
|
|
10
10
|
import '@vitest/utils/source-map';
|
|
11
|
-
import './chunks/env.
|
|
11
|
+
import './chunks/env.Dq0hM4Xv.js';
|
|
12
12
|
import 'std-env';
|
|
13
|
-
import './chunks/typechecker.
|
|
13
|
+
import './chunks/typechecker.CG0zmr19.js';
|
|
14
14
|
import 'node:fs/promises';
|
|
15
15
|
import 'tinyexec';
|
|
16
16
|
import 'vite';
|