vitest 0.18.1 → 0.19.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.
Files changed (32) hide show
  1. package/LICENSE.md +5 -5
  2. package/dist/browser.d.ts +1850 -0
  3. package/dist/browser.mjs +20 -0
  4. package/dist/{chunk-api-setup.9d3f7670.mjs → chunk-api-setup.0cf2c96a.mjs} +23 -6
  5. package/dist/{chunk-constants.d4406290.mjs → chunk-constants.38b43a44.mjs} +3 -3
  6. package/dist/{chunk-env-node.bbba78e5.mjs → chunk-defaults.408a0cfe.mjs} +456 -455
  7. package/dist/{chunk-install-pkg.2dcb2c04.mjs → chunk-install-pkg.6c6dc0c2.mjs} +11 -10
  8. package/dist/{chunk-integrations-globals.00b6e1ad.mjs → chunk-integrations-globals.803277be.mjs} +6 -5
  9. package/dist/chunk-node-git.9058b82a.mjs +1139 -0
  10. package/dist/chunk-runtime-chain.1e1aabb3.mjs +2025 -0
  11. package/dist/chunk-runtime-error.d82dd2cf.mjs +644 -0
  12. package/dist/{chunk-runtime-chain.b60d57da.mjs → chunk-runtime-hooks.db398170.mjs} +10 -2013
  13. package/dist/{chunk-runtime-mocker.1d853e3a.mjs → chunk-runtime-mocker.dfdfd57b.mjs} +3 -3
  14. package/dist/{chunk-runtime-rpc.9d1f4c48.mjs → chunk-runtime-rpc.45d8ee19.mjs} +1 -1
  15. package/dist/{chunk-utils-global.0a7416cf.mjs → chunk-utils-global.2aa95025.mjs} +11 -6
  16. package/dist/{chunk-utils-source-map.c03f8bc4.mjs → chunk-utils-source-map.8b066ce2.mjs} +2 -2
  17. package/dist/{chunk-vite-node-externalize.6956d2d9.mjs → chunk-vite-node-externalize.a2813ad7.mjs} +103 -1173
  18. package/dist/{chunk-vite-node-utils.8077cd3c.mjs → chunk-vite-node-utils.ad73f2ab.mjs} +13 -2
  19. package/dist/cli.mjs +8 -10
  20. package/dist/config.cjs +3 -1
  21. package/dist/config.d.ts +1 -0
  22. package/dist/config.mjs +3 -1
  23. package/dist/entry.mjs +14 -597
  24. package/dist/index.d.ts +39 -4
  25. package/dist/index.mjs +8 -5
  26. package/dist/node.d.ts +28 -2
  27. package/dist/node.mjs +10 -12
  28. package/dist/suite.mjs +13 -0
  29. package/dist/vendor-index.61438b77.mjs +335 -0
  30. package/dist/{vendor-index.4bf9c627.mjs → vendor-index.62ce5c33.mjs} +11 -343
  31. package/dist/worker.mjs +5 -5
  32. package/package.json +11 -3
@@ -1,8 +1,8 @@
1
- import { n as normalizeRequestId, i as isNodeBuiltin, b as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.8077cd3c.mjs';
1
+ import { n as normalizeRequestId, i as isNodeBuiltin, b as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.ad73f2ab.mjs';
2
2
  import { normalizePath } from 'vite';
3
- import { a as getWorkerState, M as isWindows, N as mergeSlashes, d as dirname, j as join, o as basename, q as resolve, s as slash, O as getType, P as getAllProperties } from './chunk-utils-global.0a7416cf.mjs';
3
+ import { g as getWorkerState, T as isWindows, U as mergeSlashes, d as dirname, j as join, D as basename, C as resolve, c as slash, q as getType, V as getAllProperties } from './chunk-utils-global.2aa95025.mjs';
4
4
  import { existsSync, readdirSync } from 'fs';
5
- import { d as distDir } from './chunk-constants.d4406290.mjs';
5
+ import { d as distDir } from './chunk-constants.38b43a44.mjs';
6
6
 
7
7
  class RefTracker {
8
8
  constructor() {
@@ -1,4 +1,4 @@
1
- import { a as getWorkerState, w as withSafeTimers } from './chunk-utils-global.0a7416cf.mjs';
1
+ import { g as getWorkerState, w as withSafeTimers } from './chunk-utils-global.2aa95025.mjs';
2
2
 
3
3
  const rpc = () => {
4
4
  const { rpc: rpc2 } = getWorkerState();
@@ -1,4 +1,4 @@
1
- import path from 'path';
1
+ import path, { relative as relative$1 } from 'path';
2
2
  import require$$0 from 'tty';
3
3
  import { isPackageExists } from 'local-pkg';
4
4
 
@@ -482,8 +482,11 @@ function withSafeTimers(fn) {
482
482
  }
483
483
  }
484
484
 
485
- const isNode = typeof process !== "undefined" && typeof process.platform !== "undefined";
485
+ var _a;
486
+ const isNode = typeof process < "u" && typeof process.stdout < "u" && !((_a = process.versions) == null ? void 0 : _a.deno) && !globalThis.window;
487
+ const isBrowser = typeof window !== "undefined";
486
488
  const isWindows = isNode && process.platform === "win32";
489
+ const relativePath = isBrowser ? relative$1 : relative;
487
490
  function partitionSuiteChildren(suite) {
488
491
  let tasksGroup = [];
489
492
  const tasksGroups = [];
@@ -515,9 +518,10 @@ function resetModules() {
515
518
  function getFullName(task) {
516
519
  return getNames(task).join(picocolors.exports.dim(" > "));
517
520
  }
518
- async function ensurePackageInstalled(dependency, promptInstall = !process.env.CI && process.stdout.isTTY) {
519
- if (isPackageExists(dependency))
521
+ async function ensurePackageInstalled(dependency, root) {
522
+ if (isPackageExists(dependency, { paths: [root] }))
520
523
  return true;
524
+ const promptInstall = !process.env.CI && process.stdout.isTTY;
521
525
  process.stderr.write(picocolors.exports.red(`${picocolors.exports.inverse(picocolors.exports.red(" MISSING DEP "))} Can not find dependency '${dependency}'
522
526
 
523
527
  `));
@@ -530,7 +534,7 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
530
534
  message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
531
535
  });
532
536
  if (install) {
533
- await (await import('./chunk-install-pkg.2dcb2c04.mjs')).installPackage(dependency, { dev: true });
537
+ await (await import('./chunk-install-pkg.6c6dc0c2.mjs')).installPackage(dependency, { dev: true });
534
538
  process.stderr.write(picocolors.exports.yellow(`
535
539
  Package ${dependency} installed, re-run the command to start.
536
540
  `));
@@ -567,6 +571,7 @@ function getCallLastIndex(code) {
567
571
  }
568
572
  return null;
569
573
  }
574
+ isNode ? relative : relative$1;
570
575
  class AggregateErrorPonyfill extends Error {
571
576
  constructor(errors, message = "") {
572
577
  super(message);
@@ -574,4 +579,4 @@ class AggregateErrorPonyfill extends Error {
574
579
  }
575
580
  }
576
581
 
577
- export { AggregateErrorPonyfill as A, safeSetInterval as B, safeClearInterval as C, getSuites as D, shuffle as E, toArray as F, normalize as G, deepMerge as H, toNamespacedPath as I, ensurePackageInstalled as J, stdout as K, extname as L, isWindows as M, mergeSlashes as N, getType as O, getAllProperties as P, deepClone as Q, RealDate as R, partitionSuiteChildren as S, hasTests as T, getWorkerState as a, getNames as b, assertTypes as c, dirname as d, getFullName as e, safeSetTimeout as f, getCallLastIndex as g, safeClearTimeout as h, isObject as i, join as j, resetModules as k, notNullish as l, mockDate as m, noop as n, basename as o, picocolors as p, resolve as q, resetDate as r, slash as s, isAbsolute as t, relative as u, isNode as v, withSafeTimers as w, getTests as x, hasFailed as y, hasFailedSnapshot as z };
582
+ export { hasTests as A, hasFailed as B, resolve as C, basename as D, AggregateErrorPonyfill as E, isAbsolute as F, relative as G, getTests as H, hasFailedSnapshot as I, safeSetInterval as J, safeClearInterval as K, getSuites as L, normalize as M, deepMerge as N, toNamespacedPath as O, ensurePackageInstalled as P, stdout as Q, RealDate as R, extname as S, isWindows as T, mergeSlashes as U, getAllProperties as V, resetModules as a, getCallLastIndex as b, slash as c, dirname as d, getNames as e, assertTypes as f, getWorkerState as g, getFullName as h, isObject as i, join as j, safeClearTimeout as k, notNullish as l, mockDate as m, noop as n, deepClone as o, picocolors as p, getType as q, resetDate as r, safeSetTimeout as s, isNode as t, toArray as u, relativePath as v, withSafeTimers as w, isBrowser as x, partitionSuiteChildren as y, shuffle as z };
@@ -1,4 +1,4 @@
1
- import { s as slash, l as notNullish, p as picocolors } from './chunk-utils-global.0a7416cf.mjs';
1
+ import { c as slash, l as notNullish, p as picocolors } from './chunk-utils-global.2aa95025.mjs';
2
2
 
3
3
  var build = {};
4
4
 
@@ -7435,4 +7435,4 @@ var matcherUtils = /*#__PURE__*/Object.freeze({
7435
7435
  diff: diff
7436
7436
  });
7437
7437
 
7438
- export { posToNumber as a, parseStacktrace as b, stripAnsi as c, cliTruncate as d, stringWidth as e, format_1 as f, getOriginalPos as g, ansiStyles as h, sliceAnsi as i, interpretSourcePos as j, lineSplitRE as l, matcherUtils as m, numberToPos as n, plugins_1 as p, stringify as s, unifiedDiff as u };
7438
+ export { plugins_1 as a, posToNumber as b, stripAnsi as c, cliTruncate as d, stringWidth as e, format_1 as f, getOriginalPos as g, ansiStyles as h, sliceAnsi as i, interpretSourcePos as j, lineSplitRE as l, matcherUtils as m, numberToPos as n, parseStacktrace as p, stringify as s, unifiedDiff as u };