vitest 0.26.0 → 0.26.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.
Files changed (40) hide show
  1. package/browser.d.ts +1 -0
  2. package/dist/browser.d.ts +5 -5
  3. package/dist/browser.js +16 -14
  4. package/dist/{chunk-api-setup.08f3b356.js → chunk-api-setup.adeab271.js} +7 -5
  5. package/dist/{chunk-env-node.67948209.js → chunk-env-node.b3664da2.js} +1 -1
  6. package/dist/{chunk-install-pkg.579a5a27.js → chunk-install-pkg.6dd2bae6.js} +19 -19
  7. package/dist/chunk-integrations-globals.96914902.js +27 -0
  8. package/dist/{chunk-node-git.5a1b1656.js → chunk-node-git.a90c0582.js} +10 -6
  9. package/dist/{chunk-runtime-chain.e655f6cc.js → chunk-runtime-chain.4cd984be.js} +7 -6
  10. package/dist/{chunk-runtime-error.dfbbf9be.js → chunk-runtime-error.f5c8aaf2.js} +6 -4
  11. package/dist/{chunk-runtime-mocker.35fabb8b.js → chunk-runtime-mocker.3fa602ba.js} +11 -4
  12. package/dist/{chunk-runtime-rpc.7959fc79.js → chunk-runtime-rpc.54d72169.js} +2 -2
  13. package/dist/{chunk-runtime-setup.4c1b529e.js → chunk-runtime-setup.9cdedce6.js} +15 -15
  14. package/dist/{chunk-snapshot-manager.7d978f79.js → chunk-snapshot-manager.e54d78b8.js} +52 -42
  15. package/dist/{chunk-typecheck-constants.3f865d14.js → chunk-typecheck-constants.06e1fe5b.js} +3 -3
  16. package/dist/{chunk-utils-env.03f840f2.js → chunk-utils-env.3fdc1793.js} +8 -8
  17. package/dist/{chunk-utils-import.ca62c9d7.js → chunk-utils-import.afe2ffde.js} +4 -4
  18. package/dist/{chunk-utils-source-map.5bbb50cd.js → chunk-utils-source-map.59ba6b0a.js} +2 -2
  19. package/dist/{chunk-utils-timers.793fd179.js → chunk-utils-timers.715da787.js} +31 -15
  20. package/dist/cli-wrapper.js +10 -5
  21. package/dist/cli.js +22 -16
  22. package/dist/config.d.ts +3 -3
  23. package/dist/entry.js +16 -14
  24. package/dist/environments.d.ts +3 -3
  25. package/dist/environments.js +2 -2
  26. package/dist/{index-c3f83a58.d.ts → index-1e9f7f83.d.ts} +1 -1
  27. package/dist/index.d.ts +6 -6
  28. package/dist/index.js +12 -10
  29. package/dist/loader.js +10 -6
  30. package/dist/node.d.ts +5 -4
  31. package/dist/node.js +25 -17
  32. package/dist/suite.js +10 -8
  33. package/dist/{types-56bcd6c3.d.ts → types-c41bae41.d.ts} +23 -6
  34. package/dist/{vendor-index.96e022fd.js → vendor-index.2e96c50b.js} +6 -2
  35. package/dist/{vendor-index.e1d4cf84.js → vendor-index.7a2cebfe.js} +16 -16
  36. package/dist/{vendor-index.737c3cff.js → vendor-index.b2fdde54.js} +9 -8
  37. package/dist/worker.js +14 -9
  38. package/environments.d.ts +1 -0
  39. package/package.json +3 -3
  40. package/dist/chunk-integrations-globals.cab94a09.js +0 -25
@@ -1,42 +1,46 @@
1
- import { j as join, c as basename, d as dirname, r as relative, b as resolve, e as distDir, f as rootDir, p as picocolors, g as isAbsolute, i as isNode, h as configFiles, k as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-utils-env.03f840f2.js';
1
+ import { j as join, c as basename, d as dirname, r as relative, b as resolve, e as distDir, f as rootDir, p as picocolors, g as isAbsolute, i as isNode, h as configFiles, k as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
2
2
  import { p as pLimit, s as someTasksAreOnly, i as interpretTaskModes, g as getCoverageProvider, C as CoverageProviderMap } from './chunk-integrations-coverage.befed097.js';
3
- import { g as getEnvPackageName } from './chunk-env-node.67948209.js';
4
- import { T as TYPECHECK_SUITE, z as ensurePackageInstalled, A as AggregateErrorPonyfill, s as slash$1, l as relativePath, B as getTests, f as getFullName, v as hasFailed, C as hasFailedSnapshot, D as getTypecheckTests, E as getSuites, F as isTypecheckTest, k as notNullish, q as shuffle, t as toArray, n as noop$1, G as deepMerge, b as getCallLastIndex, H as removeUndefinedValues, I as isWindows, J as stdout } from './chunk-typecheck-constants.3f865d14.js';
3
+ import { g as getEnvPackageName } from './chunk-env-node.b3664da2.js';
4
+ import { T as TYPECHECK_SUITE, z as ensurePackageInstalled, A as AggregateErrorPonyfill, s as slash$1, l as relativePath, B as getTests, f as getFullName, v as hasFailed, C as hasFailedSnapshot, D as getTypecheckTests, E as getSuites, F as isTypecheckTest, k as notNullish, q as shuffle, t as toArray, n as noop$1, G as deepMerge, b as getCallLastIndex, H as removeUndefinedValues, I as isWindows, J as stdout } from './chunk-typecheck-constants.06e1fe5b.js';
5
5
  import { loadConfigFromFile, normalizePath, createServer, mergeConfig } from 'vite';
6
- import path$a from 'path';
7
- import url, { fileURLToPath } from 'url';
8
- import process$1 from 'process';
9
- import fs$8, { promises, existsSync, readFileSync } from 'fs';
10
- import require$$0, { cpus, hostname } from 'os';
6
+ import path$a from 'node:path';
7
+ import url, { fileURLToPath } from 'node:url';
8
+ import process$1 from 'node:process';
9
+ import fs$8, { promises, existsSync } from 'node:fs';
10
+ import g from 'path';
11
+ import require$$0 from 'os';
11
12
  import util$2 from 'util';
12
13
  import require$$0$1 from 'stream';
13
14
  import require$$2 from 'events';
15
+ import require$$0$2, { existsSync as existsSync$1, readFileSync } from 'fs';
14
16
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
15
17
  import { ViteNodeRunner } from 'vite-node/client';
16
18
  import { ViteNodeServer } from 'vite-node/server';
17
- import { writeFile, rm } from 'fs/promises';
18
- import { e as execa } from './vendor-index.737c3cff.js';
19
+ import { writeFile, rm } from 'node:fs/promises';
20
+ import { e as execa } from './vendor-index.b2fdde54.js';
19
21
  import { SourceMapConsumer } from 'source-map';
20
22
  import H from 'module';
21
23
  import { parse as parse$4 } from 'acorn';
22
24
  import { ancestor } from 'acorn-walk';
23
- import { MessageChannel } from 'worker_threads';
25
+ import { MessageChannel } from 'node:worker_threads';
26
+ import { cpus, hostname } from 'node:os';
24
27
  import { Tinypool } from 'tinypool';
25
28
  import { c as createBirpc } from './vendor-index.783e7f3e.js';
26
29
  import { performance } from 'perf_hooks';
27
- import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.793fd179.js';
28
- import { p as parseStacktrace, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.5bbb50cd.js';
30
+ import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.715da787.js';
31
+ import { p as parseStacktrace, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.59ba6b0a.js';
29
32
  import { resolveModule } from 'local-pkg';
30
33
  import { createHash } from 'crypto';
31
34
  import { slash as slash$2 } from 'vite-node/utils';
32
35
  import { o as onetime } from './vendor-index.9c919048.js';
33
- import { s as signalExit } from './vendor-index.e1d4cf84.js';
36
+ import { s as signalExit } from './vendor-index.7a2cebfe.js';
37
+ import { createHash as createHash$1 } from 'node:crypto';
34
38
  import MagicString from './chunk-magic-string.3a794426.js';
35
39
  import { stripLiteral } from 'strip-literal';
36
- import require$$0$2 from 'readline';
40
+ import require$$0$3 from 'readline';
37
41
  import { p as prompts } from './vendor-index.9f20a9be.js';
38
42
 
39
- var version$1 = "0.26.0";
43
+ var version$1 = "0.26.1";
40
44
 
41
45
  class EndError extends Error {
42
46
  constructor(value) {
@@ -242,7 +246,7 @@ var path$9 = {};
242
246
 
243
247
  Object.defineProperty(path$9, "__esModule", { value: true });
244
248
  path$9.removeLeadingDotSegment = path$9.escape = path$9.makeAbsolute = path$9.unixify = void 0;
245
- const path$8 = path$a;
249
+ const path$8 = g;
246
250
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
247
251
  const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
248
252
  /**
@@ -448,7 +452,7 @@ var isGlob$1 = function isGlob(str, options) {
448
452
  };
449
453
 
450
454
  var isGlob = isGlob$1;
451
- var pathPosixDirname = path$a.posix.dirname;
455
+ var pathPosixDirname = g.posix.dirname;
452
456
  var isWin32 = require$$0.platform() === 'win32';
453
457
 
454
458
  var slash = '/';
@@ -1912,7 +1916,7 @@ var picomatch$2 = {exports: {}};
1912
1916
 
1913
1917
  var utils$f = {};
1914
1918
 
1915
- const path$7 = path$a;
1919
+ const path$7 = g;
1916
1920
  const WIN_SLASH = '\\\\/';
1917
1921
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1918
1922
 
@@ -2092,7 +2096,7 @@ var constants$3 = {
2092
2096
 
2093
2097
  (function (exports) {
2094
2098
 
2095
- const path = path$a;
2099
+ const path = g;
2096
2100
  const win32 = process.platform === 'win32';
2097
2101
  const {
2098
2102
  REGEX_BACKSLASH,
@@ -3636,7 +3640,7 @@ parse$1.fastpaths = (input, options) => {
3636
3640
 
3637
3641
  var parse_1 = parse$1;
3638
3642
 
3639
- const path$6 = path$a;
3643
+ const path$6 = g;
3640
3644
  const scan = scan_1;
3641
3645
  const parse = parse_1;
3642
3646
  const utils$c = utils$f;
@@ -4450,7 +4454,7 @@ var micromatch_1 = micromatch$1;
4450
4454
 
4451
4455
  Object.defineProperty(pattern$1, "__esModule", { value: true });
4452
4456
  pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
4453
- const path$5 = path$a;
4457
+ const path$5 = g;
4454
4458
  const globParent = globParent$1;
4455
4459
  const micromatch = micromatch_1;
4456
4460
  const GLOBSTAR = '**';
@@ -4999,7 +5003,7 @@ var fs$5 = {};
4999
5003
  (function (exports) {
5000
5004
  Object.defineProperty(exports, "__esModule", { value: true });
5001
5005
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
5002
- const fs = fs$8;
5006
+ const fs = require$$0$2;
5003
5007
  exports.FILE_SYSTEM_ADAPTER = {
5004
5008
  lstat: fs.lstat,
5005
5009
  stat: fs.stat,
@@ -5350,7 +5354,7 @@ var fs$1 = {};
5350
5354
  (function (exports) {
5351
5355
  Object.defineProperty(exports, "__esModule", { value: true });
5352
5356
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
5353
- const fs = fs$8;
5357
+ const fs = require$$0$2;
5354
5358
  exports.FILE_SYSTEM_ADAPTER = {
5355
5359
  lstat: fs.lstat,
5356
5360
  stat: fs.stat,
@@ -5369,7 +5373,7 @@ var fs$1 = {};
5369
5373
  } (fs$1));
5370
5374
 
5371
5375
  Object.defineProperty(settings$2, "__esModule", { value: true });
5372
- const path$3 = path$a;
5376
+ const path$3 = g;
5373
5377
  const fsStat$3 = out$1;
5374
5378
  const fs = fs$1;
5375
5379
  class Settings$1 {
@@ -6023,7 +6027,7 @@ sync$3.default = SyncProvider;
6023
6027
  var settings$1 = {};
6024
6028
 
6025
6029
  Object.defineProperty(settings$1, "__esModule", { value: true });
6026
- const path$2 = path$a;
6030
+ const path$2 = g;
6027
6031
  const fsScandir = out$2;
6028
6032
  class Settings {
6029
6033
  constructor(_options = {}) {
@@ -6085,7 +6089,7 @@ function getSettings(settingsOrOptions = {}) {
6085
6089
  var reader = {};
6086
6090
 
6087
6091
  Object.defineProperty(reader, "__esModule", { value: true });
6088
- const path$1 = path$a;
6092
+ const path$1 = g;
6089
6093
  const fsStat$2 = out$1;
6090
6094
  const utils$6 = utils$k;
6091
6095
  class Reader {
@@ -6479,7 +6483,7 @@ class EntryTransformer {
6479
6483
  entry.default = EntryTransformer;
6480
6484
 
6481
6485
  Object.defineProperty(provider, "__esModule", { value: true });
6482
- const path = path$a;
6486
+ const path = g;
6483
6487
  const deep_1 = deep;
6484
6488
  const entry_1 = entry$1;
6485
6489
  const error_1 = error;
@@ -6657,7 +6661,7 @@ var settings = {};
6657
6661
  (function (exports) {
6658
6662
  Object.defineProperty(exports, "__esModule", { value: true });
6659
6663
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
6660
- const fs = fs$8;
6664
+ const fs = require$$0$2;
6661
6665
  const os = require$$0;
6662
6666
  /**
6663
6667
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
@@ -6849,9 +6853,9 @@ function addSnapshotResult(summary, result) {
6849
6853
  summary.total += result.added + result.matched + result.unmatched + result.updated;
6850
6854
  }
6851
6855
 
6852
- function T(r){const t=/^\\\\\?\\/.test(r),n=/[^\u0000-\u0080]+/.test(r);return t||n?r:r.replace(/\\/g,"/")}function B(r,t){for(;;){const n=path$a.join(r,t);if(fs$8.existsSync(n))return T(n);const e=path$a.dirname(r);if(e===r)return;r=e;}}function G(r,t){t===void 0&&(t=!1);var n=r.length,e=0,i="",a=0,o=16,u=0,f=0,d=0,C=0,c=0;function y(s,m){for(var v=0,b=0;v<s||!m;){var h=r.charCodeAt(e);if(h>=48&&h<=57)b=b*16+h-48;else if(h>=65&&h<=70)b=b*16+h-65+10;else if(h>=97&&h<=102)b=b*16+h-97+10;else break;e++,v++;}return v<s&&(b=-1),b}function V(s){e=s,i="",a=0,o=16,c=0;}function $(){var s=e;if(r.charCodeAt(e)===48)e++;else for(e++;e<r.length&&j(r.charCodeAt(e));)e++;if(e<r.length&&r.charCodeAt(e)===46)if(e++,e<r.length&&j(r.charCodeAt(e)))for(e++;e<r.length&&j(r.charCodeAt(e));)e++;else return c=3,r.substring(s,e);var m=e;if(e<r.length&&(r.charCodeAt(e)===69||r.charCodeAt(e)===101))if(e++,(e<r.length&&r.charCodeAt(e)===43||r.charCodeAt(e)===45)&&e++,e<r.length&&j(r.charCodeAt(e))){for(e++;e<r.length&&j(r.charCodeAt(e));)e++;m=e;}else c=3;return r.substring(s,m)}function _(){for(var s="",m=e;;){if(e>=n){s+=r.substring(m,e),c=2;break}var v=r.charCodeAt(e);if(v===34){s+=r.substring(m,e),e++;break}if(v===92){if(s+=r.substring(m,e),e++,e>=n){c=2;break}var b=r.charCodeAt(e++);switch(b){case 34:s+='"';break;case 92:s+="\\";break;case 47:s+="/";break;case 98:s+="\b";break;case 102:s+="\f";break;case 110:s+=`
6856
+ function T(r){const t=/^\\\\\?\\/.test(r),n=/[^\u0000-\u0080]+/.test(r);return t||n?r:r.replace(/\\/g,"/")}function B(r,t){for(;;){const n=g.join(r,t);if(require$$0$2.existsSync(n))return T(n);const e=g.dirname(r);if(e===r)return;r=e;}}function G(r,t){t===void 0&&(t=!1);var n=r.length,e=0,i="",a=0,o=16,u=0,f=0,d=0,C=0,c=0;function y(s,m){for(var v=0,b=0;v<s||!m;){var h=r.charCodeAt(e);if(h>=48&&h<=57)b=b*16+h-48;else if(h>=65&&h<=70)b=b*16+h-65+10;else if(h>=97&&h<=102)b=b*16+h-97+10;else break;e++,v++;}return v<s&&(b=-1),b}function V(s){e=s,i="",a=0,o=16,c=0;}function $(){var s=e;if(r.charCodeAt(e)===48)e++;else for(e++;e<r.length&&j(r.charCodeAt(e));)e++;if(e<r.length&&r.charCodeAt(e)===46)if(e++,e<r.length&&j(r.charCodeAt(e)))for(e++;e<r.length&&j(r.charCodeAt(e));)e++;else return c=3,r.substring(s,e);var m=e;if(e<r.length&&(r.charCodeAt(e)===69||r.charCodeAt(e)===101))if(e++,(e<r.length&&r.charCodeAt(e)===43||r.charCodeAt(e)===45)&&e++,e<r.length&&j(r.charCodeAt(e))){for(e++;e<r.length&&j(r.charCodeAt(e));)e++;m=e;}else c=3;return r.substring(s,m)}function _(){for(var s="",m=e;;){if(e>=n){s+=r.substring(m,e),c=2;break}var v=r.charCodeAt(e);if(v===34){s+=r.substring(m,e),e++;break}if(v===92){if(s+=r.substring(m,e),e++,e>=n){c=2;break}var b=r.charCodeAt(e++);switch(b){case 34:s+='"';break;case 92:s+="\\";break;case 47:s+="/";break;case 98:s+="\b";break;case 102:s+="\f";break;case 110:s+=`
6853
6857
  `;break;case 114:s+="\r";break;case 116:s+=" ";break;case 117:var h=y(4,!0);h>=0?s+=String.fromCharCode(h):c=4;break;default:c=5;}m=e;continue}if(v>=0&&v<=31)if(P(v)){s+=r.substring(m,e),c=2;break}else c=6;e++;}return s}function S(){if(i="",c=0,a=e,f=u,C=d,e>=n)return a=n,o=17;var s=r.charCodeAt(e);if(U(s)){do e++,i+=String.fromCharCode(s),s=r.charCodeAt(e);while(U(s));return o=15}if(P(s))return e++,i+=String.fromCharCode(s),s===13&&r.charCodeAt(e)===10&&(e++,i+=`
6854
- `),u++,d=e,o=14;switch(s){case 123:return e++,o=1;case 125:return e++,o=2;case 91:return e++,o=3;case 93:return e++,o=4;case 58:return e++,o=6;case 44:return e++,o=5;case 34:return e++,i=_(),o=10;case 47:var m=e-1;if(r.charCodeAt(e+1)===47){for(e+=2;e<n&&!P(r.charCodeAt(e));)e++;return i=r.substring(m,e),o=12}if(r.charCodeAt(e+1)===42){e+=2;for(var v=n-1,b=!1;e<v;){var h=r.charCodeAt(e);if(h===42&&r.charCodeAt(e+1)===47){e+=2,b=!0;break}e++,P(h)&&(h===13&&r.charCodeAt(e)===10&&e++,u++,d=e);}return b||(e++,c=1),i=r.substring(m,e),o=13}return i+=String.fromCharCode(s),e++,o=16;case 45:if(i+=String.fromCharCode(s),e++,e===n||!j(r.charCodeAt(e)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=$(),o=11;default:for(;e<n&&k(s);)e++,s=r.charCodeAt(e);if(a!==e){switch(i=r.substring(a,e),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(s),e++,o=16}}function k(s){if(U(s)||P(s))return !1;switch(s){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function l(){var s;do s=S();while(s>=12&&s<=15);return s}return {setPosition:V,getPosition:function(){return e},scan:t?l:S,getToken:function(){return o},getTokenValue:function(){return i},getTokenOffset:function(){return a},getTokenLength:function(){return e-a},getTokenStartLine:function(){return f},getTokenStartCharacter:function(){return a-C},getTokenError:function(){return c}}}function U(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function P(r){return r===10||r===13||r===8232||r===8233}function j(r){return r>=48&&r<=57}var N;(function(r){r.DEFAULT={allowTrailingComma:!1};})(N||(N={}));function K(r,t,n){t===void 0&&(t=[]),n===void 0&&(n=N.DEFAULT);var e=null,i=[],a=[];function o(f){Array.isArray(i)?i.push(f):e!==null&&(i[e]=f);}var u={onObjectBegin:function(){var f={};o(f),a.push(i),i=f,e=null;},onObjectProperty:function(f){e=f;},onObjectEnd:function(){i=a.pop();},onArrayBegin:function(){var f=[];o(f),a.push(i),i=f,e=null;},onArrayEnd:function(){i=a.pop();},onLiteralValue:o,onError:function(f,d,C){t.push({error:f,offset:d,length:C});}};return Q(r,u,n),i[0]}function Q(r,t,n){n===void 0&&(n=N.DEFAULT);var e=G(r,!1);function i(p){return p?function(){return p(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return !0}}function a(p){return p?function(w){return p(w,e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return !0}}var o=i(t.onObjectBegin),u=a(t.onObjectProperty),f=i(t.onObjectEnd),d=i(t.onArrayBegin),C=i(t.onArrayEnd),c=a(t.onLiteralValue),y=a(t.onSeparator),V=i(t.onComment),$=a(t.onError),_=n&&n.disallowComments,S=n&&n.allowTrailingComma;function k(){for(;;){var p=e.scan();switch(e.getTokenError()){case 4:l(14);break;case 5:l(15);break;case 3:l(13);break;case 1:_||l(11);break;case 2:l(12);break;case 6:l(16);break}switch(p){case 12:case 13:_?l(10):V();break;case 16:l(1);break;case 15:case 14:break;default:return p}}}function l(p,w,L){if(w===void 0&&(w=[]),L===void 0&&(L=[]),$(p),w.length+L.length>0)for(var D=e.getToken();D!==17;){if(w.indexOf(D)!==-1){k();break}else if(L.indexOf(D)!==-1)break;D=k();}}function s(p){var w=e.getTokenValue();return p?c(w):u(w),k(),!0}function m(){switch(e.getToken()){case 11:var p=e.getTokenValue(),w=Number(p);isNaN(w)&&(l(2),w=0),c(w);break;case 7:c(null);break;case 8:c(!0);break;case 9:c(!1);break;default:return !1}return k(),!0}function v(){return e.getToken()!==10?(l(3,[],[2,5]),!1):(s(!1),e.getToken()===6?(y(":"),k(),F()||l(4,[],[2,5])):l(5,[],[2,5]),!0)}function b(){o(),k();for(var p=!1;e.getToken()!==2&&e.getToken()!==17;){if(e.getToken()===5){if(p||l(4,[],[]),y(","),k(),e.getToken()===2&&S)break}else p&&l(6,[],[]);v()||l(4,[],[2,5]),p=!0;}return f(),e.getToken()!==2?l(7,[2],[]):k(),!0}function h(){d(),k();for(var p=!1;e.getToken()!==4&&e.getToken()!==17;){if(e.getToken()===5){if(p||l(4,[],[]),y(","),k(),e.getToken()===4&&S)break}else p&&l(6,[],[]);F()||l(4,[],[4,5]),p=!0;}return C(),e.getToken()!==4?l(8,[4],[]):k(),!0}function F(){switch(e.getToken()){case 3:return h();case 1:return b();case 10:return s(!0);default:return m()}}return k(),e.getToken()===17?n.allowEmptyContent?!0:(l(4,[],[]),!1):F()?(e.getToken()!==17&&l(9,[],[]),!0):(l(4,[],[]),!1)}var X=K;const W=/^\.{1,2}(\/.*)?$/,J=r=>T(W.test(r)?r:`./${r}`),{existsSync:E}=fs$8,Y=r=>{try{return JSON.parse(r)}catch{}},Z=()=>{const{findPnpApi:r}=H;return r&&r(process.cwd())};function I(r){const t=Y(fs$8.readFileSync(r,"utf8"));return path$a.join(r,"..",t&&"tsconfig"in t?t.tsconfig:"tsconfig.json")}function x(r,t){let n=r;if(n===".."&&(n+="/tsconfig.json"),n.startsWith(".")){let a=path$a.resolve(t,n);if(E(a)&&fs$8.statSync(a).isFile()||!a.endsWith(".json")&&(a+=".json",E(a)))return a;throw new Error(`File '${r}' not found.`)}const e=Z();if(e){const{resolveRequest:a}=e,[o,u]=r.split("/"),f=o.startsWith("@")?`${o}/${u}`:o;try{if(f===r){const d=a(path$a.join(f,"package.json"),t);if(d){const C=I(d);if(E(C))return C}}else try{return a(r,t,{extensions:[".json"]})}catch{return a(path$a.join(r,"tsconfig.json"),t)}}catch{}}let i=B(t,path$a.join("node_modules",n));if(i){if(fs$8.statSync(i).isDirectory()){const a=path$a.join(i,"package.json");if(E(a)?i=I(a):i=path$a.join(i,"tsconfig.json"),E(i))return i}else if(i.endsWith(".json"))return i}if(!n.endsWith(".json")&&(n+=".json",i=B(t,path$a.join("node_modules",n)),i))return i;throw new Error(`File '${r}' not found.`)}var ee=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,q=(r,t,n)=>t in r?ee(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,A=(r,t)=>{for(var n in t||(t={}))te.call(t,n)&&q(r,n,t[n]);if(R)for(var n of R(t))ae.call(t,n)&&q(r,n,t[n]);return r},oe=(r,t)=>re(r,ne(t));function M(r){var t;let n;try{n=fs$8.realpathSync(r);}catch{throw new Error(`Cannot resolve tsconfig at path: ${r}`)}const e=path$a.dirname(n),i=fs$8.readFileSync(n,"utf8").trim();let a={};if(i&&(a=X(i),!a||typeof a!="object"))throw new SyntaxError(`Failed to parse tsconfig at: ${r}`);if(a.extends){const o=x(a.extends,e),u=M(o);if(delete u.references,(t=u.compilerOptions)!=null&&t.baseUrl){const{compilerOptions:d}=u;d.baseUrl=path$a.relative(e,path$a.join(path$a.dirname(o),d.baseUrl))||"./";}u.files&&(u.files=u.files.map(d=>path$a.relative(e,path$a.join(path$a.dirname(o),d)))),u.include&&(u.include=u.include.map(d=>path$a.relative(e,path$a.join(path$a.dirname(o),d)))),delete a.extends;const f=oe(A(A({},u),a),{compilerOptions:A(A({},u.compilerOptions),a.compilerOptions)});u.watchOptions&&(f.watchOptions=A(A({},u.watchOptions),a.watchOptions)),a=f;}if(a.compilerOptions){const{compilerOptions:o}=a;o.baseUrl&&(o.baseUrl=J(o.baseUrl)),o.outDir&&(Array.isArray(a.exclude)||(a.exclude=[]),a.exclude.push(o.outDir),o.outDir=J(o.outDir));}if(a.files&&(a.files=a.files.map(J)),a.include&&(a.include=a.include.map(T)),a.watchOptions){const{watchOptions:o}=a;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(u=>T(path$a.resolve(e,u))));}return a}function ie(r=process.cwd(),t="tsconfig.json"){const n=B(r,t);if(!n)return null;const e=M(n);return {path:n,config:e}}
6858
+ `),u++,d=e,o=14;switch(s){case 123:return e++,o=1;case 125:return e++,o=2;case 91:return e++,o=3;case 93:return e++,o=4;case 58:return e++,o=6;case 44:return e++,o=5;case 34:return e++,i=_(),o=10;case 47:var m=e-1;if(r.charCodeAt(e+1)===47){for(e+=2;e<n&&!P(r.charCodeAt(e));)e++;return i=r.substring(m,e),o=12}if(r.charCodeAt(e+1)===42){e+=2;for(var v=n-1,b=!1;e<v;){var h=r.charCodeAt(e);if(h===42&&r.charCodeAt(e+1)===47){e+=2,b=!0;break}e++,P(h)&&(h===13&&r.charCodeAt(e)===10&&e++,u++,d=e);}return b||(e++,c=1),i=r.substring(m,e),o=13}return i+=String.fromCharCode(s),e++,o=16;case 45:if(i+=String.fromCharCode(s),e++,e===n||!j(r.charCodeAt(e)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=$(),o=11;default:for(;e<n&&k(s);)e++,s=r.charCodeAt(e);if(a!==e){switch(i=r.substring(a,e),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(s),e++,o=16}}function k(s){if(U(s)||P(s))return !1;switch(s){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function l(){var s;do s=S();while(s>=12&&s<=15);return s}return {setPosition:V,getPosition:function(){return e},scan:t?l:S,getToken:function(){return o},getTokenValue:function(){return i},getTokenOffset:function(){return a},getTokenLength:function(){return e-a},getTokenStartLine:function(){return f},getTokenStartCharacter:function(){return a-C},getTokenError:function(){return c}}}function U(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function P(r){return r===10||r===13||r===8232||r===8233}function j(r){return r>=48&&r<=57}var N;(function(r){r.DEFAULT={allowTrailingComma:!1};})(N||(N={}));function K(r,t,n){t===void 0&&(t=[]),n===void 0&&(n=N.DEFAULT);var e=null,i=[],a=[];function o(f){Array.isArray(i)?i.push(f):e!==null&&(i[e]=f);}var u={onObjectBegin:function(){var f={};o(f),a.push(i),i=f,e=null;},onObjectProperty:function(f){e=f;},onObjectEnd:function(){i=a.pop();},onArrayBegin:function(){var f=[];o(f),a.push(i),i=f,e=null;},onArrayEnd:function(){i=a.pop();},onLiteralValue:o,onError:function(f,d,C){t.push({error:f,offset:d,length:C});}};return Q(r,u,n),i[0]}function Q(r,t,n){n===void 0&&(n=N.DEFAULT);var e=G(r,!1);function i(p){return p?function(){return p(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return !0}}function a(p){return p?function(w){return p(w,e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return !0}}var o=i(t.onObjectBegin),u=a(t.onObjectProperty),f=i(t.onObjectEnd),d=i(t.onArrayBegin),C=i(t.onArrayEnd),c=a(t.onLiteralValue),y=a(t.onSeparator),V=i(t.onComment),$=a(t.onError),_=n&&n.disallowComments,S=n&&n.allowTrailingComma;function k(){for(;;){var p=e.scan();switch(e.getTokenError()){case 4:l(14);break;case 5:l(15);break;case 3:l(13);break;case 1:_||l(11);break;case 2:l(12);break;case 6:l(16);break}switch(p){case 12:case 13:_?l(10):V();break;case 16:l(1);break;case 15:case 14:break;default:return p}}}function l(p,w,L){if(w===void 0&&(w=[]),L===void 0&&(L=[]),$(p),w.length+L.length>0)for(var D=e.getToken();D!==17;){if(w.indexOf(D)!==-1){k();break}else if(L.indexOf(D)!==-1)break;D=k();}}function s(p){var w=e.getTokenValue();return p?c(w):u(w),k(),!0}function m(){switch(e.getToken()){case 11:var p=e.getTokenValue(),w=Number(p);isNaN(w)&&(l(2),w=0),c(w);break;case 7:c(null);break;case 8:c(!0);break;case 9:c(!1);break;default:return !1}return k(),!0}function v(){return e.getToken()!==10?(l(3,[],[2,5]),!1):(s(!1),e.getToken()===6?(y(":"),k(),F()||l(4,[],[2,5])):l(5,[],[2,5]),!0)}function b(){o(),k();for(var p=!1;e.getToken()!==2&&e.getToken()!==17;){if(e.getToken()===5){if(p||l(4,[],[]),y(","),k(),e.getToken()===2&&S)break}else p&&l(6,[],[]);v()||l(4,[],[2,5]),p=!0;}return f(),e.getToken()!==2?l(7,[2],[]):k(),!0}function h(){d(),k();for(var p=!1;e.getToken()!==4&&e.getToken()!==17;){if(e.getToken()===5){if(p||l(4,[],[]),y(","),k(),e.getToken()===4&&S)break}else p&&l(6,[],[]);F()||l(4,[],[4,5]),p=!0;}return C(),e.getToken()!==4?l(8,[4],[]):k(),!0}function F(){switch(e.getToken()){case 3:return h();case 1:return b();case 10:return s(!0);default:return m()}}return k(),e.getToken()===17?n.allowEmptyContent?!0:(l(4,[],[]),!1):F()?(e.getToken()!==17&&l(9,[],[]),!0):(l(4,[],[]),!1)}var X=K;const W=/^\.{1,2}(\/.*)?$/,J=r=>T(W.test(r)?r:`./${r}`),{existsSync:E}=require$$0$2,Y=r=>{try{return JSON.parse(r)}catch{}},Z=()=>{const{findPnpApi:r}=H;return r&&r(process.cwd())};function I(r){const t=Y(require$$0$2.readFileSync(r,"utf8"));return g.join(r,"..",t&&"tsconfig"in t?t.tsconfig:"tsconfig.json")}function x(r,t){let n=r;if(n===".."&&(n+="/tsconfig.json"),n.startsWith(".")){let a=g.resolve(t,n);if(E(a)&&require$$0$2.statSync(a).isFile()||!a.endsWith(".json")&&(a+=".json",E(a)))return a;throw new Error(`File '${r}' not found.`)}const e=Z();if(e){const{resolveRequest:a}=e,[o,u]=r.split("/"),f=o.startsWith("@")?`${o}/${u}`:o;try{if(f===r){const d=a(g.join(f,"package.json"),t);if(d){const C=I(d);if(E(C))return C}}else try{return a(r,t,{extensions:[".json"]})}catch{return a(g.join(r,"tsconfig.json"),t)}}catch{}}let i=B(t,g.join("node_modules",n));if(i){if(require$$0$2.statSync(i).isDirectory()){const a=g.join(i,"package.json");if(E(a)?i=I(a):i=g.join(i,"tsconfig.json"),E(i))return i}else if(i.endsWith(".json"))return i}if(!n.endsWith(".json")&&(n+=".json",i=B(t,g.join("node_modules",n)),i))return i;throw new Error(`File '${r}' not found.`)}var ee=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,q=(r,t,n)=>t in r?ee(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n,A=(r,t)=>{for(var n in t||(t={}))te.call(t,n)&&q(r,n,t[n]);if(R)for(var n of R(t))ae.call(t,n)&&q(r,n,t[n]);return r},oe=(r,t)=>re(r,ne(t));function M(r){var t;let n;try{n=require$$0$2.realpathSync(r);}catch{throw new Error(`Cannot resolve tsconfig at path: ${r}`)}const e=g.dirname(n),i=require$$0$2.readFileSync(n,"utf8").trim();let a={};if(i&&(a=X(i),!a||typeof a!="object"))throw new SyntaxError(`Failed to parse tsconfig at: ${r}`);if(a.extends){const o=x(a.extends,e),u=M(o);if(delete u.references,(t=u.compilerOptions)!=null&&t.baseUrl){const{compilerOptions:d}=u;d.baseUrl=g.relative(e,g.join(g.dirname(o),d.baseUrl))||"./";}u.files&&(u.files=u.files.map(d=>g.relative(e,g.join(g.dirname(o),d)))),u.include&&(u.include=u.include.map(d=>g.relative(e,g.join(g.dirname(o),d)))),delete a.extends;const f=oe(A(A({},u),a),{compilerOptions:A(A({},u.compilerOptions),a.compilerOptions)});u.watchOptions&&(f.watchOptions=A(A({},u.watchOptions),a.watchOptions)),a=f;}if(a.compilerOptions){const{compilerOptions:o}=a;o.baseUrl&&(o.baseUrl=J(o.baseUrl)),o.outDir&&(Array.isArray(a.exclude)||(a.exclude=[]),a.exclude.push(o.outDir),o.outDir=J(o.outDir));}if(a.files&&(a.files=a.files.map(J)),a.include&&(a.include=a.include.map(T)),a.watchOptions){const{watchOptions:o}=a;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(u=>T(g.resolve(e,u))));}return a}function ie(r=process.cwd(),t="tsconfig.json"){const n=B(r,t);if(!n)return null;const e=M(n);return {path:n,config:e}}
6855
6859
 
6856
6860
  const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
6857
6861
  const newLineRegExp = /\r?\n/;
@@ -6897,7 +6901,7 @@ async function getTsconfigPath(root, config) {
6897
6901
  throw new Error("no tsconfig.json found");
6898
6902
  try {
6899
6903
  const tmpTsConfig = { ...tsconfig.config };
6900
- tmpTsConfig.compilerOptions ?? (tmpTsConfig.compilerOptions = {});
6904
+ tmpTsConfig.compilerOptions = tmpTsConfig.compilerOptions || {};
6901
6905
  tmpTsConfig.compilerOptions.emitDeclarationOnly = false;
6902
6906
  tmpTsConfig.compilerOptions.incremental = true;
6903
6907
  tmpTsConfig.compilerOptions.tsBuildInfoFile = path$a.join(
@@ -9921,7 +9925,7 @@ createLogUpdate(process$1.stdout);
9921
9925
 
9922
9926
  createLogUpdate(process$1.stderr);
9923
9927
 
9924
- var version = "0.26.0";
9928
+ var version = "0.26.1";
9925
9929
 
9926
9930
  function fileFromParsedStack(stack) {
9927
9931
  var _a, _b;
@@ -9947,7 +9951,7 @@ async function printError(error, ctx, options = {}) {
9947
9951
  }
9948
9952
  const stacks = parseStacktrace(e, fullStack);
9949
9953
  const nearest = error instanceof TypeCheckError ? error.stacks[0] : stacks.find(
9950
- (stack) => ctx.server.moduleGraph.getModuleById(stack.file) && existsSync(stack.file)
9954
+ (stack) => ctx.server.moduleGraph.getModuleById(stack.file) && existsSync$1(stack.file)
9951
9955
  );
9952
9956
  const errorProperties = getErrorProperties(e);
9953
9957
  if (type)
@@ -9959,7 +9963,7 @@ async function printError(error, ctx, options = {}) {
9959
9963
  printStack(ctx, stacks, nearest, errorProperties, (s, pos) => {
9960
9964
  if (showCodeFrame && s === nearest && nearest) {
9961
9965
  const file = fileFromParsedStack(nearest);
9962
- if (nearest.file === file || existsSync(file)) {
9966
+ if (nearest.file === file || existsSync$1(file)) {
9963
9967
  const sourceCode = readFileSync(file, "utf-8");
9964
9968
  ctx.logger.error(picocolors.exports.yellow(generateCodeFrame(sourceCode, 4, pos)));
9965
9969
  }
@@ -10035,8 +10039,14 @@ As a temporary workaround you can try to inline the package by updating your con
10035
10039
  `)
10036
10040
  ));
10037
10041
  }
10038
- function displayDiff(actual, expected, console, options) {
10039
- console.error(picocolors.exports.gray(unifiedDiff(actual, expected, options)) + "\n");
10042
+ function displayDiff(actual, expected, console, options = {}) {
10043
+ const diff = unifiedDiff(actual, expected, options);
10044
+ const dim = options.noColor ? (s) => s : picocolors.exports.dim;
10045
+ const black = options.noColor ? (s) => s : picocolors.exports.black;
10046
+ if (diff)
10047
+ console.error(diff + "\n");
10048
+ else if (actual && expected && actual !== '"undefined"' && expected !== '"undefined"')
10049
+ console.error(dim("Could not display diff. It's possible objects are too large to compare.\nTry increasing ") + black("--outputDiffMaxSize") + dim(" option.\n"));
10040
10050
  }
10041
10051
  function printErrorMessage(error, logger) {
10042
10052
  const errorName = error.name || error.nameStr || "Unknown Error";
@@ -10415,7 +10425,7 @@ class Vitest {
10415
10425
  }
10416
10426
  async filterTestsBySource(tests) {
10417
10427
  if (this.config.changed && !this.config.related) {
10418
- const { VitestGit } = await import('./chunk-node-git.5a1b1656.js');
10428
+ const { VitestGit } = await import('./chunk-node-git.a90c0582.js');
10419
10429
  const vitestGit = new VitestGit(this.config.root);
10420
10430
  const related2 = await vitestGit.findChangedFiles({
10421
10431
  changedSince: this.config.changed
@@ -10695,7 +10705,7 @@ class Vitest {
10695
10705
  }
10696
10706
 
10697
10707
  function generateCssFilenameHash(filepath) {
10698
- return createHash("md5").update(filepath).digest("hex").slice(0, 6);
10708
+ return createHash$1("md5").update(filepath).digest("hex").slice(0, 6);
10699
10709
  }
10700
10710
  function generateScopedClassName(strategy, name, filename) {
10701
10711
  if (strategy === "scoped")
@@ -11106,7 +11116,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
11106
11116
  try {
11107
11117
  await ctx.setServer(options, server);
11108
11118
  if (options.api && options.watch)
11109
- (await import('./chunk-api-setup.08f3b356.js')).setup(ctx);
11119
+ (await import('./chunk-api-setup.adeab271.js')).setup(ctx);
11110
11120
  } catch (err) {
11111
11121
  ctx.logger.printError(err, true);
11112
11122
  process.exit(1);
@@ -11220,8 +11230,8 @@ function registerConsoleShortcuts(ctx) {
11220
11230
  let rl;
11221
11231
  function on() {
11222
11232
  off();
11223
- rl = require$$0$2.createInterface({ input: process.stdin, escapeCodeTimeout: 50 });
11224
- require$$0$2.emitKeypressEvents(process.stdin, rl);
11233
+ rl = require$$0$3.createInterface({ input: process.stdin, escapeCodeTimeout: 50 });
11234
+ require$$0$3.emitKeypressEvents(process.stdin, rl);
11225
11235
  if (process.stdin.isTTY)
11226
11236
  process.stdin.setRawMode(true);
11227
11237
  process.stdin.on("keypress", keypressHandler);
@@ -1,5 +1,5 @@
1
- import { relative } from 'path';
2
- import { i as isNode, a as isBrowser, r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.03f840f2.js';
1
+ import { relative } from 'node:path';
2
+ import { i as isNode, a as isBrowser, r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
3
3
  import { isPackageExists } from 'local-pkg';
4
4
 
5
5
  const TYPECHECK_SUITE = Symbol("vitest:typecheck-suite");
@@ -290,7 +290,7 @@ async function ensurePackageInstalled(dependency, root) {
290
290
  message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
291
291
  });
292
292
  if (install) {
293
- await (await import('./chunk-install-pkg.579a5a27.js')).installPackage(dependency, { dev: true });
293
+ await (await import('./chunk-install-pkg.6dd2bae6.js')).installPackage(dependency, { dev: true });
294
294
  process.stderr.write(picocolors.exports.yellow(`
295
295
  Package ${dependency} installed, re-run the command to start.
296
296
  `));
@@ -1,6 +1,6 @@
1
1
  import require$$0 from 'tty';
2
- import url from 'url';
3
- import path from 'path';
2
+ import url from 'node:url';
3
+ import g from 'path';
4
4
 
5
5
  var picocolors = {exports: {}};
6
6
 
@@ -206,22 +206,22 @@ const toNamespacedPath = function(p) {
206
206
  return normalizeWindowsPath(p);
207
207
  };
208
208
  const extname = function(p) {
209
- return path.posix.extname(normalizeWindowsPath(p));
209
+ return g.posix.extname(normalizeWindowsPath(p));
210
210
  };
211
211
  const relative = function(from, to) {
212
- return path.posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
212
+ return g.posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
213
213
  };
214
214
  const dirname = function(p) {
215
- return path.posix.dirname(normalizeWindowsPath(p));
215
+ return g.posix.dirname(normalizeWindowsPath(p));
216
216
  };
217
217
  const format = function(p) {
218
- return normalizeWindowsPath(path.posix.format(p));
218
+ return normalizeWindowsPath(g.posix.format(p));
219
219
  };
220
220
  const basename = function(p, ext) {
221
- return path.posix.basename(normalizeWindowsPath(p), ext);
221
+ return g.posix.basename(normalizeWindowsPath(p), ext);
222
222
  };
223
223
  const parse = function(p) {
224
- return path.posix.parse(normalizeWindowsPath(p));
224
+ return g.posix.parse(normalizeWindowsPath(p));
225
225
  };
226
226
 
227
227
  const _path = /*#__PURE__*/Object.freeze({
@@ -1,10 +1,10 @@
1
- import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.e655f6cc.js';
2
- import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.3f865d14.js';
3
- import { p as parseStacktrace } from './chunk-utils-source-map.5bbb50cd.js';
1
+ import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.4cd984be.js';
2
+ import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.06e1fe5b.js';
3
+ import { p as parseStacktrace } from './chunk-utils-source-map.59ba6b0a.js';
4
4
  import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
5
5
  import util from 'util';
6
6
  import { spyOn, fn, isMockFunction, spies } from './spy.js';
7
- import { s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
7
+ import { s as safeSetTimeout } from './chunk-utils-timers.715da787.js';
8
8
  import * as chai from 'chai';
9
9
  import { assert, should } from 'chai';
10
10
 
@@ -1,5 +1,5 @@
1
- import { b as resolve } from './chunk-utils-env.03f840f2.js';
2
- import { k as notNullish } from './chunk-typecheck-constants.3f865d14.js';
1
+ import { b as resolve } from './chunk-utils-env.3fdc1793.js';
2
+ import { k as notNullish } from './chunk-typecheck-constants.06e1fe5b.js';
3
3
 
4
4
  const lineSplitRE = /\r?\n/;
5
5
  const stackIgnorePatterns = [
@@ -1,4 +1,4 @@
1
- import { p as picocolors } from './chunk-utils-env.03f840f2.js';
1
+ import { p as picocolors } from './chunk-utils-env.3fdc1793.js';
2
2
 
3
3
  const {
4
4
  setTimeout: safeSetTimeout,
@@ -3856,15 +3856,20 @@ function formatLine(line, outputTruncateLength) {
3856
3856
  function unifiedDiff(actual, expected, options = {}) {
3857
3857
  if (actual === expected)
3858
3858
  return "";
3859
- const { outputTruncateLength, outputDiffLines, showLegend = true } = options;
3859
+ const { outputTruncateLength, outputDiffLines, outputDiffMaxLines, noColor, showLegend = true } = options;
3860
3860
  const indent = " ";
3861
3861
  const diffLimit = outputDiffLines || 15;
3862
+ const diffMaxLines = outputDiffMaxLines || 50;
3862
3863
  const counts = {
3863
3864
  "+": 0,
3864
3865
  "-": 0
3865
3866
  };
3866
3867
  let previousState = null;
3867
3868
  let previousCount = 0;
3869
+ const str = (str2) => str2;
3870
+ const dim = noColor ? str : picocolors.exports.dim;
3871
+ const green = noColor ? str : picocolors.exports.green;
3872
+ const red = noColor ? str : picocolors.exports.red;
3868
3873
  function preprocess(line) {
3869
3874
  if (!line || line.match(/\\ No newline/))
3870
3875
  return;
@@ -3877,38 +3882,49 @@ function unifiedDiff(actual, expected, options = {}) {
3877
3882
  previousCount++;
3878
3883
  counts[char]++;
3879
3884
  if (previousCount === diffLimit)
3880
- return picocolors.exports.dim(`${char} ...`);
3885
+ return dim(`${char} ...`);
3881
3886
  else if (previousCount > diffLimit)
3882
3887
  return;
3883
3888
  }
3884
3889
  return line;
3885
3890
  }
3886
3891
  const msg = createPatch("string", expected, actual);
3887
- const lines = msg.split("\n").slice(5).map(preprocess).filter(Boolean);
3892
+ let lines = msg.split("\n").slice(5).map(preprocess).filter(Boolean);
3893
+ let moreLines = 0;
3888
3894
  const isCompact = counts["+"] === 1 && counts["-"] === 1 && lines.length === 2;
3895
+ if (lines.length > diffMaxLines) {
3896
+ const firstDiff = lines.findIndex((line) => line[0] === "-" || line[0] === "+");
3897
+ const displayLines = lines.slice(firstDiff - 2, diffMaxLines);
3898
+ const lastDisplayedIndex = firstDiff - 2 + diffMaxLines;
3899
+ if (lastDisplayedIndex < lines.length)
3900
+ moreLines = lines.length - lastDisplayedIndex;
3901
+ lines = displayLines;
3902
+ }
3889
3903
  let formatted = lines.map((line) => {
3890
3904
  line = line.replace(/\\"/g, '"');
3891
3905
  if (line[0] === "-") {
3892
3906
  line = formatLine(line.slice(1), outputTruncateLength);
3893
3907
  if (isCompact)
3894
- return picocolors.exports.green(line);
3895
- return picocolors.exports.green(`- ${formatLine(line, outputTruncateLength)}`);
3908
+ return green(line);
3909
+ return green(`- ${formatLine(line, outputTruncateLength)}`);
3896
3910
  }
3897
3911
  if (line[0] === "+") {
3898
3912
  line = formatLine(line.slice(1), outputTruncateLength);
3899
3913
  if (isCompact)
3900
- return picocolors.exports.red(line);
3901
- return picocolors.exports.red(`+ ${formatLine(line, outputTruncateLength)}`);
3914
+ return red(line);
3915
+ return red(`+ ${formatLine(line, outputTruncateLength)}`);
3902
3916
  }
3903
3917
  if (line.match(/@@/))
3904
3918
  return "--";
3905
3919
  return ` ${line}`;
3906
3920
  });
3921
+ if (moreLines)
3922
+ formatted.push(dim(`... ${moreLines} more lines`));
3907
3923
  if (showLegend) {
3908
3924
  if (isCompact) {
3909
3925
  formatted = [
3910
- `${picocolors.exports.green("- Expected")} ${formatted[0]}`,
3911
- `${picocolors.exports.red("+ Received")} ${formatted[1]}`
3926
+ `${green("- Expected")} ${formatted[0]}`,
3927
+ `${red("+ Received")} ${formatted[1]}`
3912
3928
  ];
3913
3929
  } else {
3914
3930
  if (formatted[0].includes('"'))
@@ -3917,13 +3933,13 @@ function unifiedDiff(actual, expected, options = {}) {
3917
3933
  if (formatted[last].endsWith('"'))
3918
3934
  formatted[last] = formatted[last].slice(0, formatted[last].length - 1);
3919
3935
  formatted.unshift(
3920
- picocolors.exports.green(`- Expected - ${counts["-"]}`),
3921
- picocolors.exports.red(`+ Received + ${counts["+"]}`),
3936
+ green(`- Expected - ${counts["-"]}`),
3937
+ red(`+ Received + ${counts["+"]}`),
3922
3938
  ""
3923
3939
  );
3924
3940
  }
3925
3941
  }
3926
- return formatted.map((i) => indent + i).join("\n");
3942
+ return formatted.map((i) => i ? indent + i : i).join("\n");
3927
3943
  }
3928
3944
 
3929
3945
  const EXPECTED_COLOR = picocolors.exports.green;
@@ -3994,8 +4010,8 @@ function matcherHint(matcherName, received = "received", expected = "expected",
3994
4010
  }
3995
4011
  const SPACE_SYMBOL = "\xB7";
3996
4012
  const replaceTrailingSpaces = (text) => text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
3997
- function stringify(object, maxDepth = 10, options) {
3998
- const MAX_LENGTH = 1e4;
4013
+ function stringify(object, maxDepth = 10, { maxLength, ...options } = {}) {
4014
+ const MAX_LENGTH = maxLength ?? 1e4;
3999
4015
  let result;
4000
4016
  try {
4001
4017
  result = format_1(object, {
@@ -1,19 +1,24 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.03f840f2.js';
3
- import { e as execa } from './vendor-index.737c3cff.js';
2
+ import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-utils-env.3fdc1793.js';
3
+ import { e as execa } from './vendor-index.b2fdde54.js';
4
4
  import 'tty';
5
+ import 'node:url';
5
6
  import 'path';
6
- import 'buffer';
7
+ import 'node:buffer';
8
+ import 'node:path';
9
+ import 'node:child_process';
10
+ import 'node:process';
11
+ import './vendor-index.7a2cebfe.js';
7
12
  import 'child_process';
8
- import 'process';
9
- import './vendor-index.e1d4cf84.js';
10
13
  import './vendor-_commonjsHelpers.addc3445.js';
11
14
  import 'fs';
12
15
  import 'assert';
13
16
  import 'events';
17
+ import 'buffer';
14
18
  import 'stream';
15
19
  import 'util';
16
20
  import 'os';
21
+ import 'node:os';
17
22
 
18
23
  const ENTRY = new URL("./cli.js", import.meta.url);
19
24
  const NODE_ARGS = [
package/dist/cli.js CHANGED
@@ -1,42 +1,48 @@
1
- import { p as picocolors, n as normalize } from './chunk-utils-env.03f840f2.js';
1
+ import { p as picocolors, n as normalize } from './chunk-utils-env.3fdc1793.js';
2
2
  import { EventEmitter } from 'events';
3
- import { v as version, s as startVitest, d as divider } from './chunk-snapshot-manager.7d978f79.js';
3
+ import { v as version, s as startVitest, d as divider } from './chunk-snapshot-manager.e54d78b8.js';
4
4
  import 'tty';
5
- import 'url';
5
+ import 'node:url';
6
6
  import 'path';
7
7
  import './chunk-integrations-coverage.befed097.js';
8
8
  import 'local-pkg';
9
- import './chunk-env-node.67948209.js';
10
- import 'console';
11
- import './chunk-typecheck-constants.3f865d14.js';
9
+ import './chunk-env-node.b3664da2.js';
10
+ import 'node:console';
11
+ import './chunk-typecheck-constants.06e1fe5b.js';
12
+ import 'node:path';
12
13
  import 'vite';
13
- import 'process';
14
- import 'fs';
14
+ import 'node:process';
15
+ import 'node:fs';
15
16
  import 'os';
16
17
  import 'util';
17
18
  import 'stream';
19
+ import 'fs';
18
20
  import './vendor-_commonjsHelpers.addc3445.js';
19
21
  import 'vite-node/client';
20
22
  import 'vite-node/server';
21
- import 'fs/promises';
22
- import './vendor-index.737c3cff.js';
23
- import 'buffer';
23
+ import 'node:fs/promises';
24
+ import './vendor-index.b2fdde54.js';
25
+ import 'node:buffer';
26
+ import 'node:child_process';
27
+ import './vendor-index.7a2cebfe.js';
24
28
  import 'child_process';
25
- import './vendor-index.e1d4cf84.js';
26
29
  import 'assert';
30
+ import 'buffer';
31
+ import 'node:os';
27
32
  import 'source-map';
28
33
  import 'module';
29
34
  import 'acorn';
30
35
  import 'acorn-walk';
31
- import 'worker_threads';
36
+ import 'node:worker_threads';
32
37
  import 'tinypool';
33
38
  import './vendor-index.783e7f3e.js';
34
39
  import 'perf_hooks';
35
- import './chunk-utils-timers.793fd179.js';
36
- import './chunk-utils-source-map.5bbb50cd.js';
40
+ import './chunk-utils-timers.715da787.js';
41
+ import './chunk-utils-source-map.59ba6b0a.js';
37
42
  import 'crypto';
38
43
  import 'vite-node/utils';
39
44
  import './vendor-index.9c919048.js';
45
+ import 'node:crypto';
40
46
  import './chunk-magic-string.3a794426.js';
41
47
  import 'strip-literal';
42
48
  import 'readline';
@@ -656,7 +662,7 @@ class CAC extends EventEmitter {
656
662
  const cac = (name = "") => new CAC(name);
657
663
 
658
664
  const cli = cac("vitest");
659
- cli.version(version).option("-r, --root <path>", "root path").option("-c, --config <path>", "path to config file").option("-u, --update", "update snapshot").option("-w, --watch", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified pattern").option("--dir <path>", "base directory to scan for the test files").option("--ui", "enable UI").option("--open", "open UI automatically (default: !process.env.CI))").option("--api [api]", "serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputTruncateLength <length>", "diff output length (default: 80)").option("--outputDiffLines <lines>", "number of diff output lines (default: 15)").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "enable coverage report").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--browser", "run tests in browser").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--dangerouslyIgnoreUnhandledErrors", "Ignore any unhandled errors that occur").option("--shard <shard>", "Test suite shard to execute in a format of <index>/<count>").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").option("--sequence <options>", "Define in what order to run tests (use --sequence.shuffle to run tests in random order)").option("--no-color", "Removes colors from the console output").option("--segfault-retry <times>", "Return tests on segment fault (default: 0)", { default: 0 }).option("--inspect", "Enable Node.js inspector").option("--inspect-brk", "Enable Node.js inspector with break").help();
665
+ cli.version(version).option("-r, --root <path>", "root path").option("-c, --config <path>", "path to config file").option("-u, --update", "update snapshot").option("-w, --watch", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified pattern").option("--dir <path>", "base directory to scan for the test files").option("--ui", "enable UI").option("--open", "open UI automatically (default: !process.env.CI))").option("--api [api]", "serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputDiffMaxSize <length>", "object diff output max size (default: 10000)").option("--outputDiffMaxLines <length>", "max lines in diff output window (default: 50)").option("--outputTruncateLength <length>", "diff output line length (default: 80)").option("--outputDiffLines <lines>", "number of lines in single diff (default: 15)").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of multiple reporters").option("--coverage", "enable coverage report").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--browser", "run tests in browser").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--logHeapUsage", "show the size of heap for each test").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--dangerouslyIgnoreUnhandledErrors", "Ignore any unhandled errors that occur").option("--shard <shard>", "Test suite shard to execute in a format of <index>/<count>").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").option("--sequence <options>", "Define in what order to run tests (use --sequence.shuffle to run tests in random order)").option("--no-color", "Removes colors from the console output").option("--segfault-retry <times>", "Return tests on segment fault (default: 0)", { default: 0 }).option("--inspect", "Enable Node.js inspector").option("--inspect-brk", "Enable Node.js inspector with break").help();
660
666
  cli.command("run [...filters]").action(run);
661
667
  cli.command("related [...filters]").action(runRelated);
662
668
  cli.command("watch [...filters]").action(watch);