vitest 2.1.0-beta.6 → 2.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 +52 -342
- package/dist/browser.d.ts +4 -2
- package/dist/browser.js +1 -1
- package/dist/chunks/{RandomSequencer.CjkAy_bL.js → RandomSequencer.Bh5-tlNJ.js} +10 -37
- package/dist/chunks/{base.BH-FAiX7.js → base.BlXpj3e_.js} +1 -29
- package/dist/chunks/{base.B-9RAXb6.js → base.CsQmmYBA.js} +2 -4
- package/dist/chunks/{cac.BZlOqtiQ.js → cac.Ce8UWvQp.js} +25 -16
- package/dist/chunks/{cli-api.B-2f6g4d.js → cli-api.KmLFBnKP.js} +2778 -3488
- package/dist/chunks/{creator.D0TxjnLa.js → creator.zfBZSJzo.js} +8 -11
- package/dist/chunks/{execute.DT9BA6zp.js → execute._eQQfgI8.js} +322 -232
- package/dist/chunks/{git.ZtkbKc8u.js → git.B5SDxu-n.js} +5 -5
- package/dist/chunks/{globals.Br36EZIp.js → globals.C03P0O1a.js} +3 -3
- package/dist/chunks/{index.CM5UI-4O.js → index.Bn75ITYg.js} +3 -3
- package/dist/chunks/index.CPD77dLA.js +133 -0
- package/dist/chunks/{index.dWDhoZDV.js → index.DkN6V87F.js} +1 -1
- package/dist/chunks/{index.m3Xip5Zz.js → index.iyKRMe3s.js} +1 -1
- package/dist/chunks/{index.C4LZENmc.js → index.zPibhCkV.js} +43 -45
- package/dist/chunks/mocker.cRtM890J.d.ts +17 -0
- package/dist/chunks/{reporters.B0Ao6Zu1.d.ts → reporters.WnPwkmgA.d.ts} +30 -22
- package/dist/chunks/{resolveConfig.C0vpvVRF.js → resolveConfig.-K5hHm0S.js} +19 -6
- package/dist/chunks/{runBaseTests.Cf8lGnUq.js → runBaseTests.9YDrdSI4.js} +6 -6
- package/dist/chunks/{setup-common.B7uEQsGB.js → setup-common.DV1PI68g.js} +1 -1
- package/dist/chunks/{utils.C3_cBsyn.js → utils.Cn0zI1t3.js} +16 -3
- package/dist/chunks/{utils.DO38lwfj.js → utils.Dbnmsfq1.js} +1 -1
- package/dist/chunks/{vi.DBepMgvg.js → vi.D6IHiKAI.js} +40 -46
- package/dist/chunks/{vite.Bvz2vSw0.d.ts → vite.D2yAwzwa.d.ts} +1 -1
- package/dist/chunks/{vm.kl9T_5ai.js → vm.CPXwWp4C.js} +1 -2
- package/dist/chunks/{worker.DTM-0OlZ.d.ts → worker.Bws9Zuxu.d.ts} +1 -1
- package/dist/chunks/{worker.CTdJUeeB.d.ts → worker.CmPmTxgH.d.ts} +1 -14
- package/dist/cli.js +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +4 -4
- package/dist/execute.d.ts +12 -13
- package/dist/execute.js +3 -2
- package/dist/index.d.ts +17 -15
- package/dist/index.js +4 -4
- package/dist/mocker.d.ts +1 -0
- package/dist/mocker.js +1 -0
- package/dist/node.d.ts +15 -7
- package/dist/node.js +18 -16
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +5 -5
- package/dist/runners.js +2 -2
- package/dist/utils.d.ts +1 -0
- package/dist/worker.js +3 -2
- package/dist/workers/forks.js +5 -4
- package/dist/workers/runVmTests.js +5 -5
- package/dist/workers/threads.js +5 -4
- package/dist/workers/vmForks.js +4 -4
- package/dist/workers/vmThreads.js +4 -4
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +6 -5
- package/mocker.d.ts +1 -0
- package/package.json +22 -17
- package/dist/chunks/index.CWhwfxXK.js +0 -835
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalize } from 'pathe';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import c from 'tinyrainbow';
|
|
4
|
-
import { t as toArray } from './base.
|
|
4
|
+
import { t as toArray } from './base.BlXpj3e_.js';
|
|
5
5
|
import { d as defaultPort, a as defaultBrowserPort } from './constants.fzPh7AOq.js';
|
|
6
6
|
|
|
7
7
|
function toArr(any) {
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "2.1.0
|
|
621
|
+
var version = "2.1.0";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1305,7 +1305,8 @@ const cliOptionsConfig = {
|
|
|
1305
1305
|
compare: null,
|
|
1306
1306
|
outputJson: null,
|
|
1307
1307
|
json: null,
|
|
1308
|
-
provide: null
|
|
1308
|
+
provide: null,
|
|
1309
|
+
filesOnly: null
|
|
1309
1310
|
};
|
|
1310
1311
|
const benchCliOptionsConfig = {
|
|
1311
1312
|
compare: {
|
|
@@ -1321,6 +1322,9 @@ const collectCliOptionsConfig = {
|
|
|
1321
1322
|
json: {
|
|
1322
1323
|
description: "Print collected tests as JSON or write to a file (Default: false)",
|
|
1323
1324
|
argument: "[true/path]"
|
|
1325
|
+
},
|
|
1326
|
+
filesOnly: {
|
|
1327
|
+
description: "Print only test files with out the test cases"
|
|
1324
1328
|
}
|
|
1325
1329
|
};
|
|
1326
1330
|
|
|
@@ -1497,13 +1501,13 @@ async function start(mode, cliFilters, options) {
|
|
|
1497
1501
|
} catch {
|
|
1498
1502
|
}
|
|
1499
1503
|
try {
|
|
1500
|
-
const { startVitest } = await import('./cli-api.
|
|
1504
|
+
const { startVitest } = await import('./cli-api.KmLFBnKP.js').then(function (n) { return n.d; });
|
|
1501
1505
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1502
1506
|
if (!ctx?.shouldKeepServer()) {
|
|
1503
1507
|
await ctx?.exit();
|
|
1504
1508
|
}
|
|
1505
1509
|
} catch (e) {
|
|
1506
|
-
const { divider } = await import('./utils.
|
|
1510
|
+
const { divider } = await import('./utils.Dbnmsfq1.js').then(function (n) { return n.u; });
|
|
1507
1511
|
console.error(`
|
|
1508
1512
|
${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
|
|
1509
1513
|
console.error(e);
|
|
@@ -1519,7 +1523,7 @@ async function init(project) {
|
|
|
1519
1523
|
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1520
1524
|
process.exit(1);
|
|
1521
1525
|
}
|
|
1522
|
-
const { create } = await import('./creator.
|
|
1526
|
+
const { create } = await import('./creator.zfBZSJzo.js');
|
|
1523
1527
|
await create();
|
|
1524
1528
|
}
|
|
1525
1529
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1528,24 +1532,29 @@ async function collect(mode, cliFilters, options) {
|
|
|
1528
1532
|
} catch {
|
|
1529
1533
|
}
|
|
1530
1534
|
try {
|
|
1531
|
-
const { prepareVitest, processCollected } = await import('./cli-api.
|
|
1535
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.KmLFBnKP.js').then(function (n) { return n.d; });
|
|
1532
1536
|
const ctx = await prepareVitest(mode, {
|
|
1533
1537
|
...normalizeCliOptions(options),
|
|
1534
1538
|
watch: false,
|
|
1535
1539
|
run: true
|
|
1536
1540
|
});
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1541
|
+
if (!options.filesOnly) {
|
|
1542
|
+
const { tests, errors } = await ctx.collect(cliFilters.map(normalize));
|
|
1543
|
+
if (errors.length) {
|
|
1544
|
+
console.error("\nThere were unhandled errors during test collection");
|
|
1545
|
+
errors.forEach((e) => console.error(e));
|
|
1546
|
+
console.error("\n\n");
|
|
1547
|
+
await ctx.close();
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
processCollected(ctx, tests, options);
|
|
1551
|
+
} else {
|
|
1552
|
+
const files = await ctx.listFiles(cliFilters.map(normalize));
|
|
1553
|
+
outputFileList(files, options);
|
|
1544
1554
|
}
|
|
1545
|
-
processCollected(ctx, tests, options);
|
|
1546
1555
|
await ctx.close();
|
|
1547
1556
|
} catch (e) {
|
|
1548
|
-
const { divider } = await import('./utils.
|
|
1557
|
+
const { divider } = await import('./utils.Dbnmsfq1.js').then(function (n) { return n.u; });
|
|
1549
1558
|
console.error(`
|
|
1550
1559
|
${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
|
|
1551
1560
|
console.error(e);
|