vitest 2.1.0-beta.6 → 2.1.0-beta.7

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.
Files changed (56) hide show
  1. package/LICENSE.md +52 -342
  2. package/dist/browser.d.ts +4 -2
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{RandomSequencer.CjkAy_bL.js → RandomSequencer.Bh5-tlNJ.js} +10 -37
  5. package/dist/chunks/{base.BH-FAiX7.js → base.BlXpj3e_.js} +1 -29
  6. package/dist/chunks/{base.B-9RAXb6.js → base.CchlWrnV.js} +2 -4
  7. package/dist/chunks/{cac.BZlOqtiQ.js → cac.B5XYKv2_.js} +25 -16
  8. package/dist/chunks/{cli-api.B-2f6g4d.js → cli-api.ByZPnilx.js} +2778 -3488
  9. package/dist/chunks/{creator.D0TxjnLa.js → creator.zfBZSJzo.js} +8 -11
  10. package/dist/chunks/{execute.DT9BA6zp.js → execute._eQQfgI8.js} +322 -232
  11. package/dist/chunks/{git.ZtkbKc8u.js → git.B5SDxu-n.js} +5 -5
  12. package/dist/chunks/{globals.Br36EZIp.js → globals.jM7MxN2t.js} +3 -3
  13. package/dist/chunks/{index.CM5UI-4O.js → index.Bn75ITYg.js} +3 -3
  14. package/dist/chunks/index.CPD77dLA.js +133 -0
  15. package/dist/chunks/{index.dWDhoZDV.js → index.CSjyR2-v.js} +1 -1
  16. package/dist/chunks/{index.C4LZENmc.js → index.DpJO1tkB.js} +40 -44
  17. package/dist/chunks/{index.m3Xip5Zz.js → index.xm8OIiKD.js} +1 -1
  18. package/dist/chunks/mocker.cRtM890J.d.ts +17 -0
  19. package/dist/chunks/{reporters.B0Ao6Zu1.d.ts → reporters.WnPwkmgA.d.ts} +30 -22
  20. package/dist/chunks/{resolveConfig.C0vpvVRF.js → resolveConfig.-K5hHm0S.js} +19 -6
  21. package/dist/chunks/{runBaseTests.Cf8lGnUq.js → runBaseTests.Cztfoflv.js} +6 -6
  22. package/dist/chunks/{setup-common.B7uEQsGB.js → setup-common.fGBFoQKJ.js} +1 -1
  23. package/dist/chunks/{utils.C3_cBsyn.js → utils.Cn0zI1t3.js} +16 -3
  24. package/dist/chunks/{utils.DO38lwfj.js → utils.Dbnmsfq1.js} +1 -1
  25. package/dist/chunks/{vi.DBepMgvg.js → vi.DGgiNzJE.js} +37 -37
  26. package/dist/chunks/{vite.Bvz2vSw0.d.ts → vite.D2yAwzwa.d.ts} +1 -1
  27. package/dist/chunks/{vm.kl9T_5ai.js → vm.CPXwWp4C.js} +1 -2
  28. package/dist/chunks/{worker.DTM-0OlZ.d.ts → worker.Bws9Zuxu.d.ts} +1 -1
  29. package/dist/chunks/{worker.CTdJUeeB.d.ts → worker.CmPmTxgH.d.ts} +1 -14
  30. package/dist/cli.js +2 -2
  31. package/dist/config.d.ts +2 -2
  32. package/dist/coverage.d.ts +1 -1
  33. package/dist/coverage.js +4 -4
  34. package/dist/execute.d.ts +12 -13
  35. package/dist/execute.js +3 -2
  36. package/dist/index.d.ts +17 -15
  37. package/dist/index.js +4 -4
  38. package/dist/mocker.d.ts +1 -0
  39. package/dist/mocker.js +1 -0
  40. package/dist/node.d.ts +15 -7
  41. package/dist/node.js +18 -16
  42. package/dist/reporters.d.ts +1 -1
  43. package/dist/reporters.js +5 -5
  44. package/dist/runners.js +2 -2
  45. package/dist/utils.d.ts +1 -0
  46. package/dist/worker.js +3 -2
  47. package/dist/workers/forks.js +5 -4
  48. package/dist/workers/runVmTests.js +5 -5
  49. package/dist/workers/threads.js +5 -4
  50. package/dist/workers/vmForks.js +4 -4
  51. package/dist/workers/vmThreads.js +4 -4
  52. package/dist/workers.d.ts +2 -2
  53. package/dist/workers.js +6 -5
  54. package/mocker.d.ts +1 -0
  55. package/package.json +22 -17
  56. 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.BH-FAiX7.js';
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-beta.6";
621
+ var version = "2.1.0-beta.7";
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.B-2f6g4d.js').then(function (n) { return n.d; });
1504
+ const { startVitest } = await import('./cli-api.ByZPnilx.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.DO38lwfj.js').then(function (n) { return n.u; });
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.D0TxjnLa.js');
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.B-2f6g4d.js').then(function (n) { return n.d; });
1535
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.ByZPnilx.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
- const { tests, errors } = await ctx.collect(cliFilters.map(normalize));
1538
- if (errors.length) {
1539
- console.error("\nThere were unhandled errors during test collection");
1540
- errors.forEach((e) => console.error(e));
1541
- console.error("\n\n");
1542
- await ctx.close();
1543
- return;
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.DO38lwfj.js').then(function (n) { return n.u; });
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);