vitest 3.0.0-beta.4 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.BJ8KO-VX.js → base.gZAre3Yy.js} +3 -3
- package/dist/chunks/{cac.BAYqQ2aM.js → cac.Davy6Tyx.js} +24 -24
- package/dist/chunks/{cli-api.Dhl34Trr.js → cli-api.DO-hp2Kx.js} +1031 -162
- package/dist/chunks/{console.CN7AiMGV.js → console.BxE0RUCr.js} +3 -3
- package/dist/chunks/{creator.Ot9GlSGw.js → creator.B8v1wNyQ.js} +3 -3
- package/dist/chunks/{execute.BMOaRArH.js → execute.4vt3NSmG.js} +3 -4
- package/dist/chunks/global.CnI8_G5V.d.ts +133 -0
- package/dist/chunks/{globals.C5RQxaV3.js → globals.BSNBk3vE.js} +2 -2
- package/dist/chunks/{index.BQbxGbG9.js → index.Bf4FgyZN.js} +1 -1
- package/dist/chunks/{index.BJDntFik.js → index.Bh7wTRhh.js} +8 -8
- package/dist/chunks/{index.B2M9nD1V.js → index.C2XSkjNu.js} +5 -5
- package/dist/chunks/{index.DQboAxJm.js → index.DfqWks-F.js} +2 -1
- package/dist/chunks/{index.CAueP3cK.js → index.DyQPL4DO.js} +200 -945
- package/dist/chunks/{index.68735LiX.js → index.TH3f4LSA.js} +2 -2
- package/dist/chunks/{index.K90BXFOx.js → index.cYxyd29h.js} +12 -12
- package/dist/chunks/{inspector.DKLceBVD.js → inspector.CU9GlB9I.js} +1 -1
- package/dist/chunks/{reporters.Dcdq51WE.d.ts → reporters.Y8BYiXBN.d.ts} +340 -239
- package/dist/chunks/{resolveConfig.kZFMjKCQ.js → resolveConfig.DATSOo7x.js} +150 -65
- package/dist/chunks/{rpc.C3q9uwRX.js → rpc.Bf456uf4.js} +1 -2
- package/dist/chunks/{runBaseTests.URiUrnWK.js → runBaseTests.Ba8jtu6O.js} +8 -8
- package/dist/chunks/{setup-common.D0zLenuv.js → setup-common.jLbIuaww.js} +1 -1
- package/dist/chunks/{RandomSequencer.DB__To1b.js → typechecker.ChNaIV36.js} +62 -115
- package/dist/chunks/{utils.yHKcm4dz.js → utils.DJWL04yX.js} +1 -1
- package/dist/chunks/{vi.Da_PT3Vw.js → vi.CjhMlMwf.js} +6 -6
- package/dist/chunks/{vite.DzluO1Kj.d.ts → vite.CQ0dHgkN.d.ts} +1 -1
- package/dist/chunks/{vm.DrFVeTXo.js → vm.CUw7ChSp.js} +5 -5
- package/dist/chunks/{worker.BIVMnzXw.d.ts → worker.B1y96qmv.d.ts} +1 -1
- package/dist/chunks/{worker.Hz_LAzfd.d.ts → worker.CIpff8Eg.d.ts} +2 -4
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +12 -11
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +17 -118
- package/dist/index.js +2 -2
- package/dist/node.d.ts +11 -8
- package/dist/node.js +27 -25
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -6
- package/dist/runners.d.ts +1 -0
- package/dist/runners.js +10 -10
- package/dist/worker.js +5 -5
- package/dist/workers/forks.js +2 -2
- package/dist/workers/runVmTests.js +7 -7
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +3 -3
- package/dist/workers/vmThreads.js +3 -3
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +8 -8
- package/package.json +17 -17
- package/dist/chunks/types.BOjykUpq.d.ts +0 -27
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as CoverageProvider, c as CoverageProviderModule } from './chunks/reporters.
|
|
1
|
+
import { b as CoverageProvider, c as CoverageProviderModule } from './chunks/reporters.Y8BYiXBN.js';
|
|
2
2
|
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.BRtC-JeT.js';
|
|
3
3
|
import * as spy$1 from '@vitest/spy';
|
|
4
4
|
import * as _vitest_utils_diff from '@vitest/utils/diff';
|
|
@@ -20,7 +20,7 @@ import '@vitest/snapshot/manager';
|
|
|
20
20
|
import 'node:fs';
|
|
21
21
|
import '@vitest/snapshot/environment';
|
|
22
22
|
import 'vite-node/client';
|
|
23
|
-
import './chunks/worker.
|
|
23
|
+
import './chunks/worker.CIpff8Eg.js';
|
|
24
24
|
import 'node:vm';
|
|
25
25
|
import '@vitest/mocker';
|
|
26
26
|
import './chunks/mocker.cRtM890J.js';
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { g as getCoverageProvider, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/coverage.BWeNbfBa.js';
|
|
2
2
|
export { s as SpyModule } from './chunks/spy.Cf_4R5Oe.js';
|
|
3
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.
|
|
3
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './chunks/setup-common.jLbIuaww.js';
|
|
4
4
|
export { collectTests, processError, startTests } from '@vitest/runner';
|
|
5
5
|
import '@vitest/spy';
|
|
6
6
|
import '@vitest/snapshot';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleCacheMap } from 'vite-node/client';
|
|
2
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
2
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.4vt3NSmG.js';
|
|
3
3
|
import { p as provideWorkerState } from './utils.C8RiOc4B.js';
|
|
4
4
|
|
|
5
5
|
let _viteNode;
|
|
@@ -26,10 +26,10 @@ async function runBaseTests(method, state) {
|
|
|
26
26
|
));
|
|
27
27
|
const [executor, { run }] = await Promise.all([
|
|
28
28
|
startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
|
|
29
|
-
import('./runBaseTests.
|
|
29
|
+
import('./runBaseTests.Ba8jtu6O.js')
|
|
30
30
|
]);
|
|
31
31
|
const fileSpecs = ctx.files.map(
|
|
32
|
-
(f) => typeof f === "string" ? { filepath: f, testLocations:
|
|
32
|
+
(f) => typeof f === "string" ? { filepath: f, testLocations: undefined } : f
|
|
33
33
|
);
|
|
34
34
|
await run(
|
|
35
35
|
method,
|
|
@@ -25,9 +25,9 @@ function mri2 (args, opts) {
|
|
|
25
25
|
var k, arr, arg, name, val, out={ _:[] };
|
|
26
26
|
var i=0, j=0, idx=0, len=args.length;
|
|
27
27
|
|
|
28
|
-
const alibi = opts.alias !==
|
|
29
|
-
const strict = opts.unknown !==
|
|
30
|
-
const defaults = opts.default !==
|
|
28
|
+
const alibi = opts.alias !== undefined;
|
|
29
|
+
const strict = opts.unknown !== undefined;
|
|
30
|
+
const defaults = opts.default !== undefined;
|
|
31
31
|
|
|
32
32
|
opts.alias = opts.alias || {};
|
|
33
33
|
opts.string = toArr(opts.string);
|
|
@@ -56,7 +56,7 @@ function mri2 (args, opts) {
|
|
|
56
56
|
for (k in opts.default) {
|
|
57
57
|
name = typeof opts.default[k];
|
|
58
58
|
arr = opts.alias[k] = opts.alias[k] || [];
|
|
59
|
-
if (opts[name] !==
|
|
59
|
+
if (opts[name] !== undefined) {
|
|
60
60
|
opts[name].push(k);
|
|
61
61
|
for (i=0; i < arr.length; i++) {
|
|
62
62
|
opts[name].push(arr[i]);
|
|
@@ -106,7 +106,7 @@ function mri2 (args, opts) {
|
|
|
106
106
|
|
|
107
107
|
if (defaults) {
|
|
108
108
|
for (k in opts.default) {
|
|
109
|
-
if (out[k] ===
|
|
109
|
+
if (out[k] === undefined) {
|
|
110
110
|
out[k] = opts.default[k];
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -359,7 +359,7 @@ class Command {
|
|
|
359
359
|
sections.push({
|
|
360
360
|
title: "Options",
|
|
361
361
|
body: options.map((option) => {
|
|
362
|
-
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default ===
|
|
362
|
+
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? "" : `(default: ${option.config.default})`}`;
|
|
363
363
|
}).join("\n")
|
|
364
364
|
});
|
|
365
365
|
}
|
|
@@ -492,8 +492,8 @@ class CAC extends EventEmitter {
|
|
|
492
492
|
return this;
|
|
493
493
|
}
|
|
494
494
|
unsetMatchedCommand() {
|
|
495
|
-
this.matchedCommand =
|
|
496
|
-
this.matchedCommandName =
|
|
495
|
+
this.matchedCommand = undefined;
|
|
496
|
+
this.matchedCommandName = undefined;
|
|
497
497
|
}
|
|
498
498
|
parse(argv = processArgs, {
|
|
499
499
|
run = true
|
|
@@ -573,13 +573,13 @@ class CAC extends EventEmitter {
|
|
|
573
573
|
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
|
574
574
|
let transforms = Object.create(null);
|
|
575
575
|
for (const cliOption of cliOptions) {
|
|
576
|
-
if (!ignoreDefault && cliOption.config.default !==
|
|
576
|
+
if (!ignoreDefault && cliOption.config.default !== undefined) {
|
|
577
577
|
for (const name of cliOption.names) {
|
|
578
578
|
options[name] = cliOption.config.default;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
if (cliOption.config.type != null) {
|
|
582
|
-
if (transforms[cliOption.name] ===
|
|
582
|
+
if (transforms[cliOption.name] === undefined) {
|
|
583
583
|
transforms[cliOption.name] = cliOption.config.type;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "3.0.
|
|
621
|
+
var version = "3.0.1";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1486,20 +1486,20 @@ function createCLI(options = {}) {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
return info;
|
|
1488
1488
|
});
|
|
1489
|
-
cli.command("run [...filters]",
|
|
1490
|
-
cli.command("related [...filters]",
|
|
1491
|
-
cli.command("watch [...filters]",
|
|
1492
|
-
cli.command("dev [...filters]",
|
|
1489
|
+
cli.command("run [...filters]", undefined, options).action(run);
|
|
1490
|
+
cli.command("related [...filters]", undefined, options).action(runRelated);
|
|
1491
|
+
cli.command("watch [...filters]", undefined, options).action(watch);
|
|
1492
|
+
cli.command("dev [...filters]", undefined, options).action(watch);
|
|
1493
1493
|
addCliOptions(
|
|
1494
|
-
cli.command("bench [...filters]",
|
|
1494
|
+
cli.command("bench [...filters]", undefined, options).action(benchmark),
|
|
1495
1495
|
benchCliOptionsConfig
|
|
1496
1496
|
);
|
|
1497
|
-
cli.command("init <project>",
|
|
1497
|
+
cli.command("init <project>", undefined, options).action(init);
|
|
1498
1498
|
addCliOptions(
|
|
1499
|
-
cli.command("list [...filters]",
|
|
1499
|
+
cli.command("list [...filters]", undefined, options).action((filters, options2) => collect("test", filters, options2)),
|
|
1500
1500
|
collectCliOptionsConfig
|
|
1501
1501
|
);
|
|
1502
|
-
cli.command("[...filters]",
|
|
1502
|
+
cli.command("[...filters]", undefined, options).action((filters, options2) => start("test", filters, options2));
|
|
1503
1503
|
return cli;
|
|
1504
1504
|
}
|
|
1505
1505
|
function parseCLI(argv, config = {}) {
|
|
@@ -1567,13 +1567,13 @@ async function start(mode, cliFilters, options) {
|
|
|
1567
1567
|
} catch {
|
|
1568
1568
|
}
|
|
1569
1569
|
try {
|
|
1570
|
-
const { startVitest } = await import('./cli-api.
|
|
1570
|
+
const { startVitest } = await import('./cli-api.DO-hp2Kx.js').then(function (n) { return n.f; });
|
|
1571
1571
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1572
1572
|
if (!ctx.shouldKeepServer()) {
|
|
1573
1573
|
await ctx.exit();
|
|
1574
1574
|
}
|
|
1575
1575
|
} catch (e) {
|
|
1576
|
-
const { divider } = await import('./utils.
|
|
1576
|
+
const { divider } = await import('./utils.DJWL04yX.js').then(function (n) { return n.u; });
|
|
1577
1577
|
console.error(`
|
|
1578
1578
|
${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
|
|
1579
1579
|
console.error(e);
|
|
@@ -1589,7 +1589,7 @@ async function init(project) {
|
|
|
1589
1589
|
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1590
1590
|
process.exit(1);
|
|
1591
1591
|
}
|
|
1592
|
-
const { create } = await import('./creator.
|
|
1592
|
+
const { create } = await import('./creator.B8v1wNyQ.js');
|
|
1593
1593
|
await create();
|
|
1594
1594
|
}
|
|
1595
1595
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1598,7 +1598,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1598
1598
|
} catch {
|
|
1599
1599
|
}
|
|
1600
1600
|
try {
|
|
1601
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1601
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DO-hp2Kx.js').then(function (n) { return n.f; });
|
|
1602
1602
|
const ctx = await prepareVitest(mode, {
|
|
1603
1603
|
...normalizeCliOptions(cliFilters, options),
|
|
1604
1604
|
watch: false,
|
|
@@ -1620,7 +1620,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1620
1620
|
}
|
|
1621
1621
|
await ctx.close();
|
|
1622
1622
|
} catch (e) {
|
|
1623
|
-
const { divider } = await import('./utils.
|
|
1623
|
+
const { divider } = await import('./utils.DJWL04yX.js').then(function (n) { return n.u; });
|
|
1624
1624
|
console.error(`
|
|
1625
1625
|
${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
|
|
1626
1626
|
console.error(e);
|