vitest 2.0.0-beta.3 → 2.0.0-beta.6

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 (44) hide show
  1. package/dist/browser.d.ts +5 -1
  2. package/dist/browser.js +18 -2
  3. package/dist/chunks/{integrations-globals.D0I8wu4f.js → integrations-globals.BK0Cn4q1.js} +3 -4
  4. package/dist/chunks/{runtime-console.CUES-L8X.js → runtime-console.DiVMr5d4.js} +54 -24
  5. package/dist/chunks/{runtime-runBaseTests.CsxVA4nP.js → runtime-runBaseTests.C-Bkopka.js} +5 -6
  6. package/dist/cli.js +2 -2
  7. package/dist/config.d.ts +1 -1
  8. package/dist/coverage.d.ts +1 -1
  9. package/dist/environments.d.ts +1 -1
  10. package/dist/execute.d.ts +2 -2
  11. package/dist/execute.js +1 -1
  12. package/dist/index-Bp1kcIfF.d.ts +1571 -0
  13. package/dist/index.d.ts +6 -1448
  14. package/dist/index.js +3 -4
  15. package/dist/node.d.ts +2 -6
  16. package/dist/node.js +6 -6
  17. package/dist/{reporters-C-3dxOaA.d.ts → reporters-qky6mwBH.d.ts} +237 -91
  18. package/dist/reporters.d.ts +1 -1
  19. package/dist/reporters.js +4 -4
  20. package/dist/runners.d.ts +2 -1
  21. package/dist/runners.js +6 -1
  22. package/dist/{suite-V5kCKZme.d.ts → suite-B5_jYIf8.d.ts} +1 -1
  23. package/dist/suite.d.ts +2 -2
  24. package/dist/vendor/{base.CfOCwoIE.js → base.D4XK-wRp.js} +2 -2
  25. package/dist/vendor/{cac.f5m2SesE.js → cac.DDQuPgBf.js} +47 -16
  26. package/dist/vendor/{cli-api.pZNNj7LX.js → cli-api.C0OPqjkb.js} +372 -200
  27. package/dist/vendor/{constants.XmjJgDXx.js → constants.TCjCaw2D.js} +2 -1
  28. package/dist/vendor/{execute.Bwzklsfj.js → execute.BHj6OMh4.js} +2 -2
  29. package/dist/vendor/{index.DOAUPIJU.js → index.CyGfDRbW.js} +34 -14
  30. package/dist/vendor/{index.BHPXakMe.js → index.DHRpy7zp.js} +1 -1
  31. package/dist/vendor/{index.BkeKAX-R.js → index.DwR86H5i.js} +26 -3
  32. package/dist/vendor/{setup-common.6St9QHh1.js → setup-common.BhJvzjns.js} +2 -2
  33. package/dist/vendor/{utils.D5gGkwyH.js → utils.YuQ3LT2a.js} +1 -1
  34. package/dist/vendor/{vi.B31D70yH.js → vi.C6AfDXK6.js} +23 -11
  35. package/dist/vendor/{vm.rKHnSoLJ.js → vm.Ow-X2mkS.js} +2 -2
  36. package/dist/workers/forks.js +2 -2
  37. package/dist/workers/runVmTests.js +4 -5
  38. package/dist/workers/threads.js +2 -2
  39. package/dist/workers/vmForks.js +3 -3
  40. package/dist/workers/vmThreads.js +3 -3
  41. package/dist/workers.d.ts +1 -1
  42. package/dist/workers.js +4 -4
  43. package/package.json +9 -9
  44. package/dist/vendor/run-once.DLomgGUH.js +0 -27
@@ -1,6 +1,6 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
2
  import { p as provideWorkerState } from './global.7bFbnyXl.js';
3
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.Bwzklsfj.js';
3
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BHj6OMh4.js';
4
4
 
5
5
  let _viteNode;
6
6
  const moduleCache = new ModuleCacheMap();
@@ -25,7 +25,7 @@ async function runBaseTests(state) {
25
25
  ctx.files.forEach((i) => state.moduleCache.delete(i));
26
26
  const [executor, { run }] = await Promise.all([
27
27
  startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
28
- import('../chunks/runtime-runBaseTests.CsxVA4nP.js')
28
+ import('../chunks/runtime-runBaseTests.C-Bkopka.js')
29
29
  ]);
30
30
  await run(
31
31
  ctx.files,
@@ -2,7 +2,7 @@ import { normalize } from 'pathe';
2
2
  import { EventEmitter } from 'events';
3
3
  import c from 'picocolors';
4
4
  import { t as toArray } from './base._gnK9Slw.js';
5
- import { d as defaultPort, a as defaultBrowserPort } from './constants.XmjJgDXx.js';
5
+ import { d as defaultPort, a as defaultBrowserPort } from './constants.TCjCaw2D.js';
6
6
 
7
7
  function toArr(any) {
8
8
  return any == null ? [] : Array.isArray(any) ? any : [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.0.0-beta.3";
621
+ var version = "2.0.0-beta.6";
622
622
 
623
623
  const apiConfig = (port) => ({
624
624
  port: {
@@ -936,18 +936,16 @@ const cliOptionsConfig = {
936
936
  subcommands: null
937
937
  // don't support custom objects
938
938
  },
939
- slowHijackESM: {
940
- description: "Let Vitest use its own module resolution on the browser to enable APIs such as vi.mock and vi.spyOn. Visit [`browser.slowHijackESM`](https://vitest.dev/config/#browser-slowhijackesm) for more information (default: `false`)"
941
- },
942
939
  isolate: {
943
940
  description: "Run every browser test file in isolation. To disable isolation, use `--browser.isolate=false` (default: `true`)"
944
941
  },
945
- fileParallelism: {
946
- description: "Should all test files run in parallel. Use `--browser.file-parallelism=false` to disable (default: same as `--file-parallelism`)"
942
+ ui: {
943
+ description: "Show Vitest UI when running tests (default: `!process.env.CI`)"
947
944
  },
948
945
  indexScripts: null,
949
946
  testerScripts: null,
950
- commands: null
947
+ commands: null,
948
+ viewport: null
951
949
  }
952
950
  },
953
951
  pool: {
@@ -1112,7 +1110,8 @@ const cliOptionsConfig = {
1112
1110
  },
1113
1111
  exclude: {
1114
1112
  description: "Additional file globs to be excluded from test",
1115
- argument: "<glob>"
1113
+ argument: "<glob>",
1114
+ array: true
1116
1115
  },
1117
1116
  expandSnapshotDiff: {
1118
1117
  description: "Show full diff when snapshot fails"
@@ -1186,15 +1185,47 @@ const cliOptionsConfig = {
1186
1185
  description: "Maximum number of concurrent tests in a suite (default: `5`)",
1187
1186
  argument: "<number>"
1188
1187
  },
1188
+ expect: {
1189
+ description: "Configuration options for `expect()` matches",
1190
+ argument: "",
1191
+ // no displayed
1192
+ subcommands: {
1193
+ requireAssertions: {
1194
+ description: "Require that all tests have at least one assertion"
1195
+ },
1196
+ poll: {
1197
+ description: "Default options for `expect.poll()`",
1198
+ argument: "",
1199
+ subcommands: {
1200
+ interval: {
1201
+ description: "Poll interval in milliseconds for `expect.poll()` assertions (default: `50`)",
1202
+ argument: "<interval>"
1203
+ },
1204
+ timeout: {
1205
+ description: "Poll timeout in milliseconds for `expect.poll()` assertions (default: `1000`)",
1206
+ argument: "<timeout>"
1207
+ }
1208
+ },
1209
+ transform(value) {
1210
+ if (typeof value !== "object")
1211
+ throw new Error(`Unexpected value for --expect.poll: ${value}. If you need to configure timeout, use --expect.poll.timeout=<timeout>`);
1212
+ return value;
1213
+ }
1214
+ }
1215
+ },
1216
+ transform(value) {
1217
+ if (typeof value !== "object")
1218
+ throw new Error(`Unexpected value for --expect: ${value}. If you need to configure expect options, use --expect.{name}=<value> syntax`);
1219
+ return value;
1220
+ }
1221
+ },
1222
+ printConsoleTrace: {
1223
+ description: "Always print console stack traces"
1224
+ },
1189
1225
  // CLI only options
1190
1226
  run: {
1191
1227
  description: "Disable watch mode"
1192
1228
  },
1193
- segfaultRetry: {
1194
- description: "Retry the test suite if it crashes due to a segfault (default: `true`)",
1195
- argument: "<times>",
1196
- default: 0
1197
- },
1198
1229
  color: {
1199
1230
  description: "Removes colors from the console output",
1200
1231
  alias: "no-color"
@@ -1417,13 +1448,13 @@ async function start(mode, cliFilters, options) {
1417
1448
  } catch {
1418
1449
  }
1419
1450
  try {
1420
- const { startVitest } = await import('./cli-api.pZNNj7LX.js').then(function (n) { return n.d; });
1451
+ const { startVitest } = await import('./cli-api.C0OPqjkb.js').then(function (n) { return n.d; });
1421
1452
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
1422
1453
  if (!(ctx == null ? void 0 : ctx.shouldKeepServer()))
1423
1454
  await (ctx == null ? void 0 : ctx.exit());
1424
1455
  return ctx;
1425
1456
  } catch (e) {
1426
- const { divider } = await import('./utils.D5gGkwyH.js').then(function (n) { return n.u; });
1457
+ const { divider } = await import('./utils.YuQ3LT2a.js').then(function (n) { return n.u; });
1427
1458
  console.error(`
1428
1459
  ${c.red(divider(c.bold(c.inverse(" Unhandled Error "))))}`);
1429
1460
  console.error(e);