vitest 4.1.5 → 5.0.0-beta.2
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 +7 -0
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +4 -4
- package/dist/chunks/{base.RR7zL1h0.js → base.Opc_YHkk.js} +10 -11
- package/dist/chunks/browser.d.BUhkKcDl.d.ts +899 -0
- package/dist/chunks/{cac.DJJmV0dT.js → cac.8N4bOkkB.js} +23 -11
- package/dist/chunks/{cli-api.Cjt90eJu.js → cli-api.B0RFke2g.js} +5799 -353
- package/dist/chunks/{config.d.A1h_Y6Jt.d.ts → config.d.D91DHYaD.d.ts} +11 -3
- package/dist/chunks/{console.3WNpx0tS.js → console.B3IRP8fX.js} +3 -1
- package/dist/chunks/{constants.CPYnjOGj.js → constants.-juJ8b_4.js} +1 -1
- package/dist/chunks/{coverage.d.BZtK59WP.d.ts → coverage.d.g2xbl2sP.d.ts} +4 -0
- package/dist/chunks/{creator.DgVhQm5q.js → creator.BqL2U_x4.js} +1 -1
- package/dist/chunks/{defaults.9aQKnqFk.js → defaults.szbHWQun.js} +4 -2
- package/dist/chunks/environment.d-DOJxxZV9.d.DOJxxZV9.d.ts +17 -0
- package/dist/chunks/general.d.DFAHgpC2.d.ts +247 -0
- package/dist/chunks/{global.d.DVsSRdQ5.d.ts → global.d.DhbKSQoV.d.ts} +4 -5
- package/dist/chunks/{globals.Dj1TGiMC.js → globals.EHmmu0nC.js} +15 -14
- package/dist/chunks/{index.DXx9Dtk7.js → index.CViWo__T.js} +5 -5
- package/dist/chunks/{startVitestModuleRunner.bRl2_oI_.js → index.CbgUM9E5.js} +731 -5
- package/dist/chunks/{test.DNmyFkvJ.js → index.D_7-4CaB.js} +2659 -14
- package/dist/chunks/{init-forks.UV3ZQGQH.js → init-forks.DMge3WTt.js} +1 -1
- package/dist/chunks/{init-threads.D3eCsY76.js → init-threads.eIoyCTon.js} +1 -1
- package/dist/chunks/{init.D98-gwRW.js → init.BVd7SaCA.js} +3 -5
- package/dist/chunks/{nativeModuleMocker.BRN2oBJd.js → nativeModuleMocker.DKpFw0pk.js} +3 -2
- package/dist/chunks/{index.BCY_7LL2.js → nativeModuleRunner.BOeMnHl4.js} +43 -12
- package/dist/chunks/node.CwFbQqI1.js +47 -0
- package/dist/chunks/{reporters.d.CEnv6XRv.d.ts → plugin.d.cIKZEZ16.d.ts} +306 -19
- package/dist/chunks/plugins.DrsmdUE2.js +37 -0
- package/dist/chunks/{rpc.MzXet3jl.js → rpc.DFRWVnRh.js} +16 -1
- package/dist/chunks/{rpc.d.B_8sPU0w.d.ts → rpc.d.7JZuxZ8u.d.ts} +19 -3
- package/dist/chunks/{setup-common.DYx3LtFI.js → setup-common.Hpq30zVk.js} +7 -3
- package/dist/chunks/{utils.BS4fH3nR.js → utils.DKODp04v.js} +3 -4
- package/dist/chunks/{vm.DVLYObm9.js → vm.2okbRRME.js} +6 -6
- package/dist/chunks/{worker.d.ZpHpO4yb.d.ts → worker.d.Bu1kXGw4.d.ts} +3 -3
- package/dist/cli.js +2 -2
- package/dist/config.cjs +4 -2
- package/dist/config.d.ts +21 -18
- package/dist/config.js +2 -2
- package/dist/index.d.ts +84 -22
- package/dist/index.js +15 -13
- package/dist/module-evaluator.d.ts +5 -3
- package/dist/module-evaluator.js +1 -1
- package/dist/node.d.ts +114 -19
- package/dist/node.js +21 -26
- package/dist/runtime.d.ts +40 -4
- package/dist/runtime.js +5 -6
- package/dist/{chunks/traces.DT5aQ62U.js → traces.js} +1 -1
- package/dist/worker.d.ts +5 -5
- package/dist/worker.js +21 -23
- package/dist/workers/forks.js +21 -23
- package/dist/workers/runVmTests.js +17 -16
- package/dist/workers/threads.js +21 -23
- package/dist/workers/vmForks.js +7 -9
- package/dist/workers/vmThreads.js +7 -9
- package/package.json +21 -38
- package/dist/chunks/benchmark.CX_oY03V.js +0 -40
- package/dist/chunks/benchmark.d.DAaHLpsq.d.ts +0 -24
- package/dist/chunks/browser.d.BcoexmFG.d.ts +0 -62
- package/dist/chunks/coverage.DM_a_rWm.js +0 -1087
- package/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -17
- package/dist/chunks/index.DC7d2Pf8.js +0 -729
- package/dist/chunks/index.DdgEv5B1.js +0 -42
- package/dist/chunks/index.UpGiHP7g.js +0 -4255
- package/dist/chunks/nativeModuleRunner.BIakptoF.js +0 -36
- package/dist/chunks/node.COQbm6gK.js +0 -14
- package/dist/chunks/plugin.d.BM2TCi12.d.ts +0 -38
- package/dist/chunks/suite.d.udJtyAgw.d.ts +0 -10
- package/dist/chunks/traces.d.D2T_R8rx.d.ts +0 -60
- package/dist/coverage.d.ts +0 -123
- package/dist/coverage.js +0 -27
- package/dist/environments.d.ts +0 -22
- package/dist/environments.js +0 -5
- package/dist/reporters.d.ts +0 -27
- package/dist/reporters.js +0 -26
- package/dist/runners.d.ts +0 -70
- package/dist/runners.js +0 -19
- package/dist/snapshot.d.ts +0 -9
- package/dist/snapshot.js +0 -6
- package/dist/suite.d.ts +0 -5
- package/dist/suite.js +0 -8
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { normalize } from 'pathe';
|
|
4
4
|
import c$2, { disableDefaultColors } from 'tinyrainbow';
|
|
5
5
|
import './env.D4Lgay0q.js';
|
|
6
|
-
import {
|
|
6
|
+
import { a as defaultPort, d as defaultBrowserPort } from './constants.-juJ8b_4.js';
|
|
7
7
|
import assert from 'node:assert';
|
|
8
8
|
import { isAgent } from 'std-env';
|
|
9
9
|
|
|
@@ -621,7 +621,7 @@ class CAC extends EventEmitter {
|
|
|
621
621
|
|
|
622
622
|
const cac = (name = "") => new CAC(name);
|
|
623
623
|
|
|
624
|
-
var version = "
|
|
624
|
+
var version = "5.0.0-beta.2";
|
|
625
625
|
|
|
626
626
|
const apiConfig = (port) => ({
|
|
627
627
|
port: {
|
|
@@ -834,7 +834,8 @@ const cliOptionsConfig = {
|
|
|
834
834
|
htmlDir: {
|
|
835
835
|
description: "Directory of HTML coverage output to be served in UI mode and HTML reporter.",
|
|
836
836
|
argument: "<path>"
|
|
837
|
-
}
|
|
837
|
+
},
|
|
838
|
+
autoAttachSubprocess: { description: "Track coverage of the `node:child_process` and `node:worker_threads` spawned during test run. Supported only by `v8` provider. (default: false)" }
|
|
838
839
|
}
|
|
839
840
|
},
|
|
840
841
|
mode: {
|
|
@@ -886,6 +887,16 @@ const cliOptionsConfig = {
|
|
|
886
887
|
return { mode: value };
|
|
887
888
|
}
|
|
888
889
|
},
|
|
890
|
+
traceView: {
|
|
891
|
+
description: "Enable Vitest trace-view collection for browser tests (default: `false`)",
|
|
892
|
+
argument: "",
|
|
893
|
+
transform: transformNestedBoolean,
|
|
894
|
+
subcommands: {
|
|
895
|
+
enabled: { description: "Enable Vitest trace-view collection for browser tests (default: `false`)" },
|
|
896
|
+
recordCanvas: { description: "Capture canvas pixels in trace-view snapshots (default: `false`)" },
|
|
897
|
+
inlineImages: { description: "Inline loaded image pixels in trace-view snapshots (default: `false`)" }
|
|
898
|
+
}
|
|
899
|
+
},
|
|
889
900
|
orchestratorScripts: null,
|
|
890
901
|
commands: null,
|
|
891
902
|
viewport: null,
|
|
@@ -1171,7 +1182,7 @@ const cliOptionsConfig = {
|
|
|
1171
1182
|
printConsoleTrace: { description: "Always print console stack traces" },
|
|
1172
1183
|
includeTaskLocation: { description: "Collect test and suite locations in the `location` property" },
|
|
1173
1184
|
attachmentsDir: {
|
|
1174
|
-
description: "The directory where attachments from `context.annotate` are stored in (default: `.vitest
|
|
1185
|
+
description: "The directory where attachments from `context.annotate` are stored in (default: `.vitest/attachments`)",
|
|
1175
1186
|
argument: "<dir>"
|
|
1176
1187
|
},
|
|
1177
1188
|
run: { description: "Disable watch mode" },
|
|
@@ -1189,7 +1200,7 @@ const cliOptionsConfig = {
|
|
|
1189
1200
|
description: "Path to a blob reports directory. If this options is used, Vitest won't run any tests, it will only report previously recorded tests",
|
|
1190
1201
|
argument: "[path]",
|
|
1191
1202
|
transform(value) {
|
|
1192
|
-
if (!value || typeof value === "boolean") return ".vitest
|
|
1203
|
+
if (!value || typeof value === "boolean") return ".vitest/blob";
|
|
1193
1204
|
return value;
|
|
1194
1205
|
}
|
|
1195
1206
|
},
|
|
@@ -1294,7 +1305,8 @@ const cliOptionsConfig = {
|
|
|
1294
1305
|
staticParseConcurrency: null,
|
|
1295
1306
|
projects: null,
|
|
1296
1307
|
watchTriggerPatterns: null,
|
|
1297
|
-
tags: null
|
|
1308
|
+
tags: null,
|
|
1309
|
+
taskTitleValueFormatTruncate: null
|
|
1298
1310
|
};
|
|
1299
1311
|
const benchCliOptionsConfig = {
|
|
1300
1312
|
compare: {
|
|
@@ -2336,11 +2348,11 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
2336
2348
|
}
|
|
2337
2349
|
async function start(mode, cliFilters, options) {
|
|
2338
2350
|
try {
|
|
2339
|
-
const { startVitest } = await import('./cli-api.
|
|
2351
|
+
const { startVitest } = await import('./cli-api.B0RFke2g.js').then(function (n) { return n.K; });
|
|
2340
2352
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
2341
2353
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
2342
2354
|
} catch (e) {
|
|
2343
|
-
const { errorBanner } = await import('./utils.
|
|
2355
|
+
const { errorBanner } = await import('./utils.DKODp04v.js').then(function (n) { return n.u; });
|
|
2344
2356
|
console.error(`\n${errorBanner("Startup Error")}`);
|
|
2345
2357
|
console.error(e);
|
|
2346
2358
|
console.error("\n\n");
|
|
@@ -2353,12 +2365,12 @@ async function init(project) {
|
|
|
2353
2365
|
console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
|
|
2354
2366
|
process.exit(1);
|
|
2355
2367
|
}
|
|
2356
|
-
const { create } = await import('./creator.
|
|
2368
|
+
const { create } = await import('./creator.BqL2U_x4.js');
|
|
2357
2369
|
await create();
|
|
2358
2370
|
}
|
|
2359
2371
|
async function collect(mode, cliFilters, options) {
|
|
2360
2372
|
try {
|
|
2361
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
2373
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.B0RFke2g.js').then(function (n) { return n.K; });
|
|
2362
2374
|
const ctx = await prepareVitest(mode, {
|
|
2363
2375
|
...normalizeCliOptions(cliFilters, options),
|
|
2364
2376
|
watch: false,
|
|
@@ -2380,7 +2392,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
2380
2392
|
} else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
|
|
2381
2393
|
await ctx.close();
|
|
2382
2394
|
} catch (e) {
|
|
2383
|
-
const { errorBanner } = await import('./utils.
|
|
2395
|
+
const { errorBanner } = await import('./utils.DKODp04v.js').then(function (n) { return n.u; });
|
|
2384
2396
|
console.error(`\n${errorBanner("Collect Error")}`);
|
|
2385
2397
|
console.error(e);
|
|
2386
2398
|
console.error("\n\n");
|