vitest 2.1.0 → 2.1.2

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 (52) hide show
  1. package/dist/browser.d.ts +5 -5
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{base.BlXpj3e_.js → base.DwXGwWst.js} +1 -10
  4. package/dist/chunks/{base.CsQmmYBA.js → base.tiemDJX6.js} +1 -1
  5. package/dist/chunks/{benchmark.puBFxyfE.d.ts → benchmark.JVlTzojj.d.ts} +2 -0
  6. package/dist/chunks/{cac.Ce8UWvQp.js → cac.B9PaPYY1.js} +7 -7
  7. package/dist/chunks/cli-api.CHxC4-U8.js +11754 -0
  8. package/dist/chunks/{config.CHuotKvS.d.ts → config.Crbj2GAb.d.ts} +3 -0
  9. package/dist/chunks/{creator.zfBZSJzo.js → creator.Cf-MKt9i.js} +7 -10
  10. package/dist/chunks/{environment.C5eAp3K6.d.ts → environment.CzISCQ7o.d.ts} +1 -0
  11. package/dist/chunks/{globals.C03P0O1a.js → globals.HsM2o-0O.js} +3 -3
  12. package/dist/chunks/{index.Bn75ITYg.js → index.BpojBOif.js} +34 -25
  13. package/dist/chunks/{index.DkN6V87F.js → index.Ckn0Cw1h.js} +2 -1
  14. package/dist/chunks/{index.zPibhCkV.js → index.FcPVJkIQ.js} +633 -582
  15. package/dist/chunks/index.mAqbj9F9.js +140 -0
  16. package/dist/chunks/{reporters.WnPwkmgA.d.ts → reporters.DAfKSDh5.d.ts} +17 -12
  17. package/dist/chunks/{resolveConfig.-K5hHm0S.js → resolveConfig.D1DENLPF.js} +3490 -3338
  18. package/dist/chunks/{runBaseTests.9YDrdSI4.js → runBaseTests.D-Gcin7G.js} +5 -5
  19. package/dist/chunks/{setup-common.DV1PI68g.js → setup-common.DF96bIYE.js} +1 -1
  20. package/dist/chunks/{suite.CcK46U-P.d.ts → suite.BMWOKiTe.d.ts} +1 -1
  21. package/dist/chunks/{utils.Dbnmsfq1.js → utils.CY6Spixo.js} +26 -47
  22. package/dist/chunks/vi.DUs2eKik.js +3943 -0
  23. package/dist/chunks/{vite.D2yAwzwa.d.ts → vite.8fk186v-.d.ts} +1 -1
  24. package/dist/chunks/{worker.CmPmTxgH.d.ts → worker.Chrs-_NL.d.ts} +2 -2
  25. package/dist/chunks/{worker.Bws9Zuxu.d.ts → worker.Qtv8v5nL.d.ts} +1 -1
  26. package/dist/cli.js +2 -2
  27. package/dist/config.cjs +2 -1
  28. package/dist/config.d.ts +5 -5
  29. package/dist/config.js +2 -1
  30. package/dist/coverage.d.ts +4 -4
  31. package/dist/coverage.js +2 -2
  32. package/dist/environments.d.ts +2 -2
  33. package/dist/execute.d.ts +3 -3
  34. package/dist/index.d.ts +14 -14
  35. package/dist/index.js +5 -5
  36. package/dist/node.d.ts +8 -8
  37. package/dist/node.js +9 -9
  38. package/dist/reporters.d.ts +4 -4
  39. package/dist/reporters.js +4 -3
  40. package/dist/runners.d.ts +1 -1
  41. package/dist/runners.js +8 -2
  42. package/dist/suite.d.ts +2 -2
  43. package/dist/worker.js +11 -3
  44. package/dist/workers/forks.js +1 -1
  45. package/dist/workers/runVmTests.js +8 -5
  46. package/dist/workers/threads.js +1 -1
  47. package/dist/workers.d.ts +4 -4
  48. package/dist/workers.js +2 -2
  49. package/package.json +11 -12
  50. package/dist/chunks/cli-api.KmLFBnKP.js +0 -11397
  51. package/dist/chunks/index.iyKRMe3s.js +0 -131
  52. package/dist/chunks/vi.D6IHiKAI.js +0 -3746
@@ -5,16 +5,16 @@ import '@vitest/runner/utils';
5
5
  import { getSafeTimers } from '@vitest/utils';
6
6
  import { g as getWorkerState } from './utils.Ck2hJTRs.js';
7
7
  import './env.CmHVDJnw.js';
8
- import { a as globalExpect, r as resetModules, v as vi } from './vi.D6IHiKAI.js';
8
+ import { a as globalExpect, r as resetModules, v as vi } from './vi.DUs2eKik.js';
9
9
  import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from './coverage.zlNdAMHK.js';
10
- import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.DkN6V87F.js';
10
+ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.Ckn0Cw1h.js';
11
11
  import { createRequire } from 'node:module';
12
12
  import util from 'node:util';
13
13
  import timers from 'node:timers';
14
14
  import { installSourcemapsSupport } from 'vite-node/source-map';
15
15
  import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
16
- import { V as VitestIndex } from './index.iyKRMe3s.js';
17
- import { s as setupCommonEnv } from './setup-common.DV1PI68g.js';
16
+ import { V as VitestIndex } from './index.mAqbj9F9.js';
17
+ import { s as setupCommonEnv } from './setup-common.DF96bIYE.js';
18
18
  import { c as closeInspector } from './inspector.70d6emsh.js';
19
19
  import 'std-env';
20
20
  import 'chai';
@@ -24,7 +24,7 @@ import '@vitest/snapshot';
24
24
  import '@vitest/utils/error';
25
25
  import './tasks.BZnCS9aT.js';
26
26
  import '@vitest/utils/source-map';
27
- import './base.BlXpj3e_.js';
27
+ import './base.DwXGwWst.js';
28
28
  import './date.W2xKR2qe.js';
29
29
  import '@vitest/spy';
30
30
  import '../path.js';
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
13
13
  globalSetup = true;
14
14
  setSafeTimers();
15
15
  if (config.globals) {
16
- (await import('./globals.C03P0O1a.js')).registerApiGlobally();
16
+ (await import('./globals.HsM2o-0O.js')).registerApiGlobally();
17
17
  }
18
18
  }
19
19
  function setupDefines(defines) {
@@ -1,6 +1,6 @@
1
1
  import { Custom } from '@vitest/runner';
2
2
  import '@vitest/runner/utils';
3
- import { b as BenchFunction, c as BenchmarkAPI } from './benchmark.puBFxyfE.js';
3
+ import { b as BenchFunction, c as BenchmarkAPI } from './benchmark.JVlTzojj.js';
4
4
  import { Options } from 'tinybench';
5
5
 
6
6
  declare function getBenchOptions(key: Custom): Options;
@@ -1,6 +1,7 @@
1
+ import { stripVTControlCharacters } from 'node:util';
1
2
  import { isAbsolute, relative, dirname, basename } from 'pathe';
2
3
  import c from 'tinyrainbow';
3
- import { a as slash } from './base.BlXpj3e_.js';
4
+ import { a as slash } from './base.DwXGwWst.js';
4
5
 
5
6
  const F_RIGHT = "\u2192";
6
7
  const F_DOWN = "\u2193";
@@ -11,28 +12,6 @@ const F_CHECK = "\u2713";
11
12
  const F_CROSS = "\xD7";
12
13
  const F_LONG_DASH = "\u23AF";
13
14
 
14
- function ansiRegex({onlyFirst = false} = {}) {
15
- const pattern = [
16
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
17
- '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
18
- ].join('|');
19
-
20
- return new RegExp(pattern, onlyFirst ? undefined : 'g');
21
- }
22
-
23
- const regex = ansiRegex();
24
-
25
- function stripAnsi(string) {
26
- if (typeof string !== 'string') {
27
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
28
- }
29
-
30
- // Even though the regex is global, we don't need to reset the `.lastIndex`
31
- // because unlike `.exec()` and `.test()`, `.replace()` does it automatically
32
- // and doing it manually has a performance penalty.
33
- return string.replace(regex, '');
34
- }
35
-
36
15
  const spinnerMap = /* @__PURE__ */ new WeakMap();
37
16
  const hookSpinnerMap = /* @__PURE__ */ new WeakMap();
38
17
  const pointer = c.yellow(F_POINTER);
@@ -52,7 +31,7 @@ function getCols(delta = 0) {
52
31
  function divider(text, left, right) {
53
32
  const cols = getCols();
54
33
  if (text) {
55
- const textLength = stripAnsi(text).length;
34
+ const textLength = stripVTControlCharacters(text).length;
56
35
  if (left == null && right != null) {
57
36
  left = cols - textLength - right;
58
37
  } else {
@@ -202,28 +181,28 @@ function formatProjectName(name, suffix = " ") {
202
181
  }
203
182
 
204
183
  var utils = /*#__PURE__*/Object.freeze({
205
- __proto__: null,
206
- benchmarkPass: benchmarkPass,
207
- countTestErrors: countTestErrors,
208
- divider: divider,
209
- elegantSpinner: elegantSpinner,
210
- formatProjectName: formatProjectName,
211
- formatTestPath: formatTestPath,
212
- formatTimeString: formatTimeString,
213
- getCols: getCols,
214
- getHookStateSymbol: getHookStateSymbol,
215
- getStateString: getStateString,
216
- getStateSymbol: getStateSymbol,
217
- hookSpinnerMap: hookSpinnerMap,
218
- pending: pending,
219
- pointer: pointer,
220
- renderSnapshotSummary: renderSnapshotSummary,
221
- skipped: skipped,
222
- spinnerFrames: spinnerFrames,
223
- spinnerMap: spinnerMap,
224
- suiteFail: suiteFail,
225
- taskFail: taskFail,
226
- testPass: testPass
184
+ __proto__: null,
185
+ benchmarkPass: benchmarkPass,
186
+ countTestErrors: countTestErrors,
187
+ divider: divider,
188
+ elegantSpinner: elegantSpinner,
189
+ formatProjectName: formatProjectName,
190
+ formatTestPath: formatTestPath,
191
+ formatTimeString: formatTimeString,
192
+ getCols: getCols,
193
+ getHookStateSymbol: getHookStateSymbol,
194
+ getStateString: getStateString,
195
+ getStateSymbol: getStateSymbol,
196
+ hookSpinnerMap: hookSpinnerMap,
197
+ pending: pending,
198
+ pointer: pointer,
199
+ renderSnapshotSummary: renderSnapshotSummary,
200
+ skipped: skipped,
201
+ spinnerFrames: spinnerFrames,
202
+ spinnerMap: spinnerMap,
203
+ suiteFail: suiteFail,
204
+ taskFail: taskFail,
205
+ testPass: testPass
227
206
  });
228
207
 
229
- export { F_RIGHT as F, F_POINTER as a, getStateString as b, formatTimeString as c, countTestErrors as d, divider as e, formatProjectName as f, getStateSymbol as g, getCols as h, getHookStateSymbol as i, renderSnapshotSummary as r, stripAnsi as s, taskFail as t, utils as u };
208
+ export { F_RIGHT as F, F_POINTER as a, getStateString as b, formatTimeString as c, countTestErrors as d, divider as e, formatProjectName as f, getStateSymbol as g, getCols as h, getHookStateSymbol as i, renderSnapshotSummary as r, taskFail as t, utils as u };