vitest 3.2.0-beta.1 → 3.2.0-beta.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 (46) hide show
  1. package/LICENSE.md +0 -232
  2. package/dist/browser.d.ts +2 -0
  3. package/dist/browser.js +3 -4
  4. package/dist/chunks/{base.SfTiRNZf.js → base.DwtwORaC.js} +2 -2
  5. package/dist/chunks/{cac.TfX2-DVH.js → cac.I9MLYfT-.js} +10 -8
  6. package/dist/chunks/{cli-api.2970Nj9J.js → cli-api.d6IK1pnk.js} +48 -16
  7. package/dist/chunks/{coverage.z0LVMxgb.js → coverage.OGU09Jbh.js} +126 -4215
  8. package/dist/chunks/{creator.CuL7xDWI.js → creator.DGAdZ4Hj.js} +18 -39
  9. package/dist/chunks/{execute.BpmIjFTD.js → execute.JlGHLJZT.js} +3 -5
  10. package/dist/chunks/{global.d.BCOHQEpR.d.ts → global.d.BPa1eL3O.d.ts} +10 -10
  11. package/dist/chunks/{globals.Cg4NtV4P.js → globals.CpxW8ccg.js} +1 -2
  12. package/dist/chunks/{index.Bw6JxgX8.js → index.CK1YOQaa.js} +7 -7
  13. package/dist/chunks/{index.CUacZlWG.js → index.CV36oG_L.js} +881 -948
  14. package/dist/chunks/{index.BPc7M5ni.js → index.CfXMNXHg.js} +1 -13
  15. package/dist/chunks/index.CmC5OK9L.js +275 -0
  16. package/dist/chunks/{index.DbWBPwtH.js → index.DswW_LEs.js} +1 -1
  17. package/dist/chunks/{index.DBIGubLC.js → index.X0nbfr6-.js} +7 -7
  18. package/dist/chunks/{reporters.d.DGm4k1Wx.d.ts → reporters.d.CLC9rhKy.d.ts} +17 -0
  19. package/dist/chunks/{runBaseTests.CguliJB5.js → runBaseTests.Dn2vyej_.js} +3 -4
  20. package/dist/chunks/{setup-common.BP6KrF_Z.js → setup-common.CYo3Y0dD.js} +1 -3
  21. package/dist/chunks/typechecker.DnTrplSJ.js +897 -0
  22. package/dist/chunks/{vite.d.DjP_ALCZ.d.ts → vite.d.CBZ3M_ru.d.ts} +1 -1
  23. package/dist/chunks/{vm.CuLHT1BG.js → vm.C1HHjtNS.js} +1 -1
  24. package/dist/cli.js +20 -1
  25. package/dist/config.d.ts +3 -3
  26. package/dist/coverage.d.ts +1 -1
  27. package/dist/coverage.js +4 -7
  28. package/dist/execute.js +1 -1
  29. package/dist/index.d.ts +5 -27
  30. package/dist/index.js +1 -2
  31. package/dist/node.d.ts +4 -4
  32. package/dist/node.js +16 -18
  33. package/dist/reporters.d.ts +1 -1
  34. package/dist/reporters.js +14 -14
  35. package/dist/workers/forks.js +2 -2
  36. package/dist/workers/runVmTests.js +3 -4
  37. package/dist/workers/threads.js +2 -2
  38. package/dist/workers/vmForks.js +2 -2
  39. package/dist/workers/vmThreads.js +2 -2
  40. package/dist/workers.js +3 -3
  41. package/package.json +15 -19
  42. package/dist/chunks/run-once.Dimr7O9f.js +0 -47
  43. package/dist/chunks/typechecker.DYQbn8uK.js +0 -956
  44. package/dist/chunks/utils.8gfOgtry.js +0 -207
  45. package/dist/utils.d.ts +0 -3
  46. package/dist/utils.js +0 -2
package/LICENSE.md CHANGED
@@ -170,35 +170,6 @@ Repository: git+https://github.com/antfu/birpc.git
170
170
 
171
171
  ---------------------------------------
172
172
 
173
- ## braces
174
- License: MIT
175
- By: Jon Schlinkert, Brian Woodward, Elan Shanker, Eugene Sharygin, hemanth.hm
176
- Repository: micromatch/braces
177
-
178
- > The MIT License (MIT)
179
- >
180
- > Copyright (c) 2014-present, Jon Schlinkert.
181
- >
182
- > Permission is hereby granted, free of charge, to any person obtaining a copy
183
- > of this software and associated documentation files (the "Software"), to deal
184
- > in the Software without restriction, including without limitation the rights
185
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
186
- > copies of the Software, and to permit persons to whom the Software is
187
- > furnished to do so, subject to the following conditions:
188
- >
189
- > The above copyright notice and this permission notice shall be included in
190
- > all copies or substantial portions of the Software.
191
- >
192
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
193
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
194
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
195
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
196
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
197
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
198
- > THE SOFTWARE.
199
-
200
- ---------------------------------------
201
-
202
173
  ## cac
203
174
  License: MIT
204
175
  By: egoist
@@ -257,35 +228,6 @@ Repository: https://github.com/debitoor/chai-subset.git
257
228
 
258
229
  ---------------------------------------
259
230
 
260
- ## fill-range
261
- License: MIT
262
- By: Jon Schlinkert, Edo Rivai, Paul Miller, Rouven Weßling
263
- Repository: jonschlinkert/fill-range
264
-
265
- > The MIT License (MIT)
266
- >
267
- > Copyright (c) 2014-present, Jon Schlinkert.
268
- >
269
- > Permission is hereby granted, free of charge, to any person obtaining a copy
270
- > of this software and associated documentation files (the "Software"), to deal
271
- > in the Software without restriction, including without limitation the rights
272
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
273
- > copies of the Software, and to permit persons to whom the Software is
274
- > furnished to do so, subject to the following conditions:
275
- >
276
- > The above copyright notice and this permission notice shall be included in
277
- > all copies or substantial portions of the Software.
278
- >
279
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
280
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
281
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
282
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
283
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
284
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
285
- > THE SOFTWARE.
286
-
287
- ---------------------------------------
288
-
289
231
  ## find-up
290
232
  License: MIT
291
233
  By: Sindre Sorhus
@@ -326,64 +268,6 @@ Repository: git+https://github.com/WebReflection/flatted.git
326
268
 
327
269
  ---------------------------------------
328
270
 
329
- ## get-tsconfig
330
- License: MIT
331
- By: Hiroki Osame
332
- Repository: privatenumber/get-tsconfig
333
-
334
- > MIT License
335
- >
336
- > Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
337
- >
338
- > Permission is hereby granted, free of charge, to any person obtaining a copy
339
- > of this software and associated documentation files (the "Software"), to deal
340
- > in the Software without restriction, including without limitation the rights
341
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
342
- > copies of the Software, and to permit persons to whom the Software is
343
- > furnished to do so, subject to the following conditions:
344
- >
345
- > The above copyright notice and this permission notice shall be included in all
346
- > copies or substantial portions of the Software.
347
- >
348
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
349
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
350
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
351
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
352
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
353
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
354
- > SOFTWARE.
355
-
356
- ---------------------------------------
357
-
358
- ## is-number
359
- License: MIT
360
- By: Jon Schlinkert, Olsten Larck, Rouven Weßling
361
- Repository: jonschlinkert/is-number
362
-
363
- > The MIT License (MIT)
364
- >
365
- > Copyright (c) 2014-present, Jon Schlinkert.
366
- >
367
- > Permission is hereby granted, free of charge, to any person obtaining a copy
368
- > of this software and associated documentation files (the "Software"), to deal
369
- > in the Software without restriction, including without limitation the rights
370
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
371
- > copies of the Software, and to permit persons to whom the Software is
372
- > furnished to do so, subject to the following conditions:
373
- >
374
- > The above copyright notice and this permission notice shall be included in
375
- > all copies or substantial portions of the Software.
376
- >
377
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
378
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
379
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
380
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
381
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
382
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
383
- > THE SOFTWARE.
384
-
385
- ---------------------------------------
386
-
387
271
  ## js-tokens
388
272
  License: MIT
389
273
  By: Simon Lydell
@@ -488,35 +372,6 @@ Repository: sindresorhus/locate-path
488
372
 
489
373
  ---------------------------------------
490
374
 
491
- ## micromatch
492
- License: MIT
493
- By: Jon Schlinkert, Amila Welihinda, Bogdan Chadkin, Brian Woodward, Devon Govett, Elan Shanker, Fabrício Matté, Martin Kolárik, Olsten Larck, Paul Miller, Tom Byrer, Tyler Akins, Peter Bright, Kuba Juszczyk
494
- Repository: micromatch/micromatch
495
-
496
- > The MIT License (MIT)
497
- >
498
- > Copyright (c) 2014-present, Jon Schlinkert.
499
- >
500
- > Permission is hereby granted, free of charge, to any person obtaining a copy
501
- > of this software and associated documentation files (the "Software"), to deal
502
- > in the Software without restriction, including without limitation the rights
503
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
504
- > copies of the Software, and to permit persons to whom the Software is
505
- > furnished to do so, subject to the following conditions:
506
- >
507
- > The above copyright notice and this permission notice shall be included in
508
- > all copies or substantial portions of the Software.
509
- >
510
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
511
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
512
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
513
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
514
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
515
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
516
- > THE SOFTWARE.
517
-
518
- ---------------------------------------
519
-
520
375
  ## mlly
521
376
  License: MIT
522
377
  Repository: unjs/mlly
@@ -608,35 +463,6 @@ Repository: git+https://github.com/antfu-collective/package-manager-detector.git
608
463
 
609
464
  ---------------------------------------
610
465
 
611
- ## picomatch
612
- License: MIT
613
- By: Jon Schlinkert
614
- Repository: micromatch/picomatch
615
-
616
- > The MIT License (MIT)
617
- >
618
- > Copyright (c) 2017-present, Jon Schlinkert.
619
- >
620
- > Permission is hereby granted, free of charge, to any person obtaining a copy
621
- > of this software and associated documentation files (the "Software"), to deal
622
- > in the Software without restriction, including without limitation the rights
623
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
624
- > copies of the Software, and to permit persons to whom the Software is
625
- > furnished to do so, subject to the following conditions:
626
- >
627
- > The above copyright notice and this permission notice shall be included in
628
- > all copies or substantial portions of the Software.
629
- >
630
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
631
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
632
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
633
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
634
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
635
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
636
- > THE SOFTWARE.
637
-
638
- ---------------------------------------
639
-
640
466
  ## prompts
641
467
  License: MIT
642
468
  By: Terkel Gjervig
@@ -695,35 +521,6 @@ Repository: git+https://github.com/quansync-dev/quansync.git
695
521
 
696
522
  ---------------------------------------
697
523
 
698
- ## resolve-pkg-maps
699
- License: MIT
700
- By: Hiroki Osame
701
- Repository: privatenumber/resolve-pkg-maps
702
-
703
- > MIT License
704
- >
705
- > Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
706
- >
707
- > Permission is hereby granted, free of charge, to any person obtaining a copy
708
- > of this software and associated documentation files (the "Software"), to deal
709
- > in the Software without restriction, including without limitation the rights
710
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
711
- > copies of the Software, and to permit persons to whom the Software is
712
- > furnished to do so, subject to the following conditions:
713
- >
714
- > The above copyright notice and this permission notice shall be included in all
715
- > copies or substantial portions of the Software.
716
- >
717
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
718
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
719
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
720
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
721
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
722
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
723
- > SOFTWARE.
724
-
725
- ---------------------------------------
726
-
727
524
  ## sisteransi
728
525
  License: MIT
729
526
  By: Terkel Gjervig
@@ -782,35 +579,6 @@ Repository: git+https://github.com/antfu/strip-literal.git
782
579
 
783
580
  ---------------------------------------
784
581
 
785
- ## to-regex-range
786
- License: MIT
787
- By: Jon Schlinkert, Rouven Weßling
788
- Repository: micromatch/to-regex-range
789
-
790
- > The MIT License (MIT)
791
- >
792
- > Copyright (c) 2015-present, Jon Schlinkert.
793
- >
794
- > Permission is hereby granted, free of charge, to any person obtaining a copy
795
- > of this software and associated documentation files (the "Software"), to deal
796
- > in the Software without restriction, including without limitation the rights
797
- > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
798
- > copies of the Software, and to permit persons to whom the Software is
799
- > furnished to do so, subject to the following conditions:
800
- >
801
- > The above copyright notice and this permission notice shall be included in
802
- > all copies or substantial portions of the Software.
803
- >
804
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
805
- > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
806
- > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
807
- > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
808
- > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
809
- > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
810
- > THE SOFTWARE.
811
-
812
- ---------------------------------------
813
-
814
582
  ## type-detect
815
583
  License: MIT
816
584
  By: Jake Luer, Keith Cirkel, David Losert, Aleksey Shvayka, Lucas Fernandes da Costa, Grant Snodgrass, Jeremy Tice, Edward Betts, dvlsg, Amila Welihinda, Jake Champion, Miroslav Bajtoš
package/dist/browser.d.ts CHANGED
@@ -5,6 +5,8 @@ import { VitestExecutor } from './execute.js';
5
5
  export { collectTests, processError, startTests } from '@vitest/runner';
6
6
  import * as spy from '@vitest/spy';
7
7
  export { spy as SpyModule };
8
+ export { LoupeOptions, ParsedStack, StringifyOptions, format, getSafeTimers, inspect, stringify } from '@vitest/utils';
9
+ export { TraceMap, originalPositionFor } from '@vitest/utils/source-map';
8
10
  import '@vitest/pretty-format';
9
11
  import '@vitest/snapshot';
10
12
  import '@vitest/snapshot/environment';
package/dist/browser.js CHANGED
@@ -1,9 +1,8 @@
1
- export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.BP6KrF_Z.js';
1
+ export { l as loadDiffConfig, b as loadSnapshotSerializers, c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.CYo3Y0dD.js';
2
2
  export { collectTests, processError, startTests } from '@vitest/runner';
3
3
  import * as spy from '@vitest/spy';
4
4
  export { spy as SpyModule };
5
+ export { format, getSafeTimers, inspect, stringify } from '@vitest/utils';
6
+ export { TraceMap, originalPositionFor } from '@vitest/utils/source-map';
5
7
  import './chunks/coverage.0iPg4Wrz.js';
6
8
  import '@vitest/snapshot';
7
- import '@vitest/utils';
8
- import './chunks/run-once.Dimr7O9f.js';
9
- import './chunks/utils.CgTj3MsC.js';
@@ -1,5 +1,5 @@
1
1
  import { ModuleCacheMap } from 'vite-node/client';
2
- import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.BpmIjFTD.js';
2
+ import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.JlGHLJZT.js';
3
3
  import { p as provideWorkerState } from './utils.CgTj3MsC.js';
4
4
 
5
5
  let _viteNode;
@@ -27,7 +27,7 @@ async function runBaseTests(method, state) {
27
27
  const [executor, { run }] = await Promise.all([startViteNode({
28
28
  state,
29
29
  requestStubs: getDefaultRequestStubs()
30
- }), import('./runBaseTests.CguliJB5.js')]);
30
+ }), import('./runBaseTests.Dn2vyej_.js')]);
31
31
  const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
32
32
  filepath: f,
33
33
  testLocations: undefined
@@ -3,6 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import { normalize } from 'pathe';
4
4
  import c from 'tinyrainbow';
5
5
  import { a as defaultPort, d as defaultBrowserPort } from './constants.BZZyIeIE.js';
6
+ import { R as ReportersMap } from './index.CV36oG_L.js';
6
7
 
7
8
  function toArr(any) {
8
9
  return any == null ? [] : Array.isArray(any) ? any : [any];
@@ -618,7 +619,7 @@ class CAC extends EventEmitter {
618
619
 
619
620
  const cac = (name = "") => new CAC(name);
620
621
 
621
- var version = "3.2.0-beta.1";
622
+ var version = "3.2.0-beta.2";
622
623
 
623
624
  const apiConfig = (port) => ({
624
625
  port: {
@@ -716,7 +717,7 @@ const cliOptionsConfig = {
716
717
  hideSkippedTests: { description: "Hide logs for skipped tests" },
717
718
  reporters: {
718
719
  alias: "reporter",
719
- description: "Specify reporters",
720
+ description: `Specify reporters (${Object.keys(ReportersMap).join(", ")})`,
720
721
  argument: "<name>",
721
722
  subcommands: null,
722
723
  array: true
@@ -1004,7 +1005,8 @@ const cliOptionsConfig = {
1004
1005
  setupFiles: {
1005
1006
  description: "Changes the order in which setup files are executed. Accepted values are: \"list\" and \"parallel\". If set to \"list\", will run setup files in the order they are defined. If set to \"parallel\", will run setup files in parallel (default: `\"parallel\"`)",
1006
1007
  argument: "<order>"
1007
- }
1008
+ },
1009
+ groupOrder: null
1008
1010
  }
1009
1011
  },
1010
1012
  inspect: {
@@ -1466,13 +1468,13 @@ async function start(mode, cliFilters, options) {
1466
1468
  process.title = "node (vitest)";
1467
1469
  } catch {}
1468
1470
  try {
1469
- const { startVitest } = await import('./cli-api.2970Nj9J.js').then(function (n) { return n.f; });
1471
+ const { startVitest } = await import('./cli-api.d6IK1pnk.js').then(function (n) { return n.f; });
1470
1472
  const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
1471
1473
  if (!ctx.shouldKeepServer()) {
1472
1474
  await ctx.exit();
1473
1475
  }
1474
1476
  } catch (e) {
1475
- const { errorBanner } = await import('./utils.8gfOgtry.js').then(function (n) { return n.u; });
1477
+ const { errorBanner } = await import('./index.CV36oG_L.js').then(function (n) { return n.u; });
1476
1478
  console.error(`\n${errorBanner("Startup Error")}`);
1477
1479
  console.error(e);
1478
1480
  console.error("\n\n");
@@ -1487,7 +1489,7 @@ async function init(project) {
1487
1489
  console.error(new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
1488
1490
  process.exit(1);
1489
1491
  }
1490
- const { create } = await import('./creator.CuL7xDWI.js');
1492
+ const { create } = await import('./creator.DGAdZ4Hj.js');
1491
1493
  await create();
1492
1494
  }
1493
1495
  async function collect(mode, cliFilters, options) {
@@ -1495,7 +1497,7 @@ async function collect(mode, cliFilters, options) {
1495
1497
  process.title = "node (vitest)";
1496
1498
  } catch {}
1497
1499
  try {
1498
- const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.2970Nj9J.js').then(function (n) { return n.f; });
1500
+ const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.d6IK1pnk.js').then(function (n) { return n.f; });
1499
1501
  const ctx = await prepareVitest(mode, {
1500
1502
  ...normalizeCliOptions(cliFilters, options),
1501
1503
  watch: false,
@@ -1517,7 +1519,7 @@ async function collect(mode, cliFilters, options) {
1517
1519
  }
1518
1520
  await ctx.close();
1519
1521
  } catch (e) {
1520
- const { errorBanner } = await import('./utils.8gfOgtry.js').then(function (n) { return n.u; });
1522
+ const { errorBanner } = await import('./index.CV36oG_L.js').then(function (n) { return n.u; });
1521
1523
  console.error(`\n${errorBanner("Collect Error")}`);
1522
1524
  console.error(e);
1523
1525
  console.error("\n\n");
@@ -1,9 +1,9 @@
1
1
  import { promises, existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { extname, normalize, relative, dirname, resolve, join, basename, isAbsolute } from 'pathe';
3
3
  import { C as CoverageProviderMap } from './coverage.0iPg4Wrz.js';
4
- import p, { resolve as resolve$1 } from 'node:path';
4
+ import path, { resolve as resolve$1 } from 'node:path';
5
5
  import { noop, isPrimitive, createDefer, highlight, toArray, deepMerge, nanoid, slash, deepClone, notNullish } from '@vitest/utils';
6
- import { f as findUp, p as prompt } from './index.DBIGubLC.js';
6
+ import { f as findUp, p as prompt } from './index.X0nbfr6-.js';
7
7
  import * as vite from 'vite';
8
8
  import { searchForWorkspaceRoot, version, mergeConfig, createServer } from 'vite';
9
9
  import { A as API_PATH, c as configFiles, d as defaultBrowserPort, w as workspacesFiles, a as defaultPort } from './constants.BZZyIeIE.js';
@@ -11,9 +11,9 @@ import { generateFileHash, limitConcurrency, createFileTask, hasFailed, getTasks
11
11
  import { SnapshotManager } from '@vitest/snapshot/manager';
12
12
  import { ViteNodeRunner } from 'vite-node/client';
13
13
  import { ViteNodeServer } from 'vite-node/server';
14
- import { v as version$1 } from './cac.TfX2-DVH.js';
14
+ import { v as version$1 } from './cac.I9MLYfT-.js';
15
15
  import { c as createBirpc } from './index.CJ0plNrh.js';
16
- import { p as parse, s as stringify, g as printError, h as generateCodeFrame, b as BenchmarkReportsMap, R as ReportersMap, i as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.CUacZlWG.js';
16
+ import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, j as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.CV36oG_L.js';
17
17
  import require$$0$3 from 'events';
18
18
  import require$$1$1 from 'https';
19
19
  import require$$2 from 'http';
@@ -28,21 +28,22 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
28
28
  import { parseErrorStacktrace } from '@vitest/utils/source-map';
29
29
  import crypto from 'node:crypto';
30
30
  import { distDir, rootDir } from '../path.js';
31
- import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, g as getFilePoolName, d as isBrowserEnabled, m as mm, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.z0LVMxgb.js';
32
- import { c as convertTasksToEvents } from './typechecker.DYQbn8uK.js';
31
+ import { R as RandomSequencer, i as isPackageExists, h as hash, V as VitestCache, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.OGU09Jbh.js';
32
+ import { c as convertTasksToEvents } from './typechecker.DnTrplSJ.js';
33
33
  import { Console } from 'node:console';
34
34
  import c from 'tinyrainbow';
35
- import { c as formatProjectName, w as withLabel, e as errorBanner, d as divider } from './utils.8gfOgtry.js';
36
35
  import { createRequire } from 'node:module';
37
36
  import url from 'node:url';
38
37
  import { i as isTTY, a as isWindows } from './env.Dq0hM4Xv.js';
39
38
  import { rm } from 'node:fs/promises';
40
39
  import nodeos__default, { tmpdir } from 'node:os';
40
+ import pm from 'picomatch';
41
41
  import { glob, isDynamicPattern } from 'tinyglobby';
42
42
  import { normalizeRequestId, cleanUrl } from 'vite-node/utils';
43
43
  import { hoistMocksPlugin, automockPlugin } from '@vitest/mocker/node';
44
44
  import { c as configDefaults } from './defaults.DSxsTG0h.js';
45
45
  import MagicString from 'magic-string';
46
+ import { a as BenchmarkReportsMap } from './index.CmC5OK9L.js';
46
47
  import assert$1 from 'node:assert';
47
48
  import { serializeError } from '@vitest/utils/error';
48
49
  import readline from 'node:readline';
@@ -5606,7 +5607,7 @@ class VitestPackageInstaller {
5606
5607
  if (!isTTY) {
5607
5608
  return false;
5608
5609
  }
5609
- const prompts = await import('./index.DBIGubLC.js').then(function (n) { return n.i; });
5610
+ const prompts = await import('./index.X0nbfr6-.js').then(function (n) { return n.i; });
5610
5611
  const { install } = await prompts.default({
5611
5612
  type: "confirm",
5612
5613
  name: "install",
@@ -5614,7 +5615,7 @@ class VitestPackageInstaller {
5614
5615
  });
5615
5616
  if (install) {
5616
5617
  const packageName = version ? `${dependency}@${version}` : dependency;
5617
- await (await import('./index.Bw6JxgX8.js')).installPackage(packageName, { dev: true });
5618
+ await (await import('./index.CK1YOQaa.js')).installPackage(packageName, { dev: true });
5618
5619
  process.stderr.write(c.yellow(`\nPackage ${packageName} installed, re-run the command to start.\n`));
5619
5620
  process.exit();
5620
5621
  return true;
@@ -6916,6 +6917,7 @@ class TestProject {
6916
6917
  /** @internal */ typechecker;
6917
6918
  /** @internal */ _config;
6918
6919
  /** @internal */ _vite;
6920
+ /** @internal */ _hash;
6919
6921
  runner;
6920
6922
  closingPromise;
6921
6923
  testFilesList = null;
@@ -6930,6 +6932,17 @@ class TestProject {
6930
6932
  this.globalConfig = vitest.config;
6931
6933
  }
6932
6934
  /**
6935
+ * The unique hash of this project. This value is consistent between the reruns.
6936
+ *
6937
+ * It is based on the root of the project (not consistent between OS) and its name.
6938
+ */
6939
+ get hash() {
6940
+ if (!this._hash) {
6941
+ throw new Error("The server was not set. It means that `project.hash` was called before the Vite server was established.");
6942
+ }
6943
+ return this._hash;
6944
+ }
6945
+ /**
6933
6946
  * Provide a value to the test context. This value will be available to all tests with `inject`.
6934
6947
  */
6935
6948
  provide = (key, value) => {
@@ -7159,7 +7172,7 @@ class TestProject {
7159
7172
  expandDirectories: false
7160
7173
  };
7161
7174
  const files = await glob(include, globOptions);
7162
- return files.map((file) => slash(p.resolve(cwd, file)));
7175
+ return files.map((file) => slash(path.resolve(cwd, file)));
7163
7176
  }
7164
7177
  /**
7165
7178
  * Test if a file matches the test globs. This does the actual glob matching if the test is not cached, unlike `isCachedTestFile`.
@@ -7169,14 +7182,14 @@ class TestProject {
7169
7182
  return true;
7170
7183
  }
7171
7184
  const relativeId = relative(this.config.dir || this.config.root, moduleId);
7172
- if (mm.isMatch(relativeId, this.config.exclude)) {
7185
+ if (pm.isMatch(relativeId, this.config.exclude)) {
7173
7186
  return false;
7174
7187
  }
7175
- if (mm.isMatch(relativeId, this.config.include)) {
7188
+ if (pm.isMatch(relativeId, this.config.include)) {
7176
7189
  this.markTestFile(moduleId);
7177
7190
  return true;
7178
7191
  }
7179
- if (this.config.includeSource?.length && mm.isMatch(relativeId, this.config.includeSource)) {
7192
+ if (this.config.includeSource?.length && pm.isMatch(relativeId, this.config.includeSource)) {
7180
7193
  const code = source?.() || readFileSync(moduleId, "utf-8");
7181
7194
  if (this.isInSourceTestCode(code)) {
7182
7195
  this.markTestFile(moduleId);
@@ -7278,12 +7291,16 @@ class TestProject {
7278
7291
  setServer(options, server) {
7279
7292
  return this._configureServer(options, server);
7280
7293
  }
7294
+ _setHash() {
7295
+ this._hash = generateHash(this._config.root + this._config.name);
7296
+ }
7281
7297
  /** @internal */
7282
7298
  async _configureServer(options, server) {
7283
7299
  this._config = resolveConfig(this.vitest, {
7284
7300
  ...options,
7285
7301
  coverage: this.vitest.config.coverage
7286
7302
  }, server.config);
7303
+ this._setHash();
7287
7304
  for (const _providedKey in this.config.provide) {
7288
7305
  const providedKey = _providedKey;
7289
7306
  this.provide(providedKey, this.config.provide[providedKey]);
@@ -7343,6 +7360,7 @@ class TestProject {
7343
7360
  project.runner = vitest.runner;
7344
7361
  project._vite = vitest.server;
7345
7362
  project._config = vitest.config;
7363
+ project._setHash();
7346
7364
  project._provideObject(vitest.config.provide);
7347
7365
  return project;
7348
7366
  }
@@ -7353,6 +7371,7 @@ class TestProject {
7353
7371
  clone.runner = parent.runner;
7354
7372
  clone._vite = parent._vite;
7355
7373
  clone._config = config;
7374
+ clone._setHash();
7356
7375
  clone._parent = parent;
7357
7376
  clone._provideObject(config.provide);
7358
7377
  return clone;
@@ -7385,6 +7404,18 @@ async function initializeProject(workspacePath, ctx, options) {
7385
7404
  await createViteServer(config);
7386
7405
  return project;
7387
7406
  }
7407
+ function generateHash(str) {
7408
+ let hash = 0;
7409
+ if (str.length === 0) {
7410
+ return `${hash}`;
7411
+ }
7412
+ for (let i = 0; i < str.length; i++) {
7413
+ const char = str.charCodeAt(i);
7414
+ hash = (hash << 5) - hash + char;
7415
+ hash = hash & hash;
7416
+ }
7417
+ return `${hash}`;
7418
+ }
7388
7419
 
7389
7420
  async function resolveProjects(vitest, cliOptions, workspaceConfigPath, projectsDefinition, names) {
7390
7421
  const { configFiles, projectConfigs, nonConfigDirectories } = await resolveTestProjectConfigs(vitest, workspaceConfigPath, projectsDefinition);
@@ -7560,7 +7591,7 @@ async function resolveBrowserProjects(vitest, names, resolvedProjects) {
7560
7591
  if (!isTTY) {
7561
7592
  throw new Error(`${message} Please, filter projects with --browser=name or --project=name flag or run tests with "headless: true" option.`);
7562
7593
  }
7563
- const prompts = await import('./index.DBIGubLC.js').then(function (n) { return n.i; });
7594
+ const prompts = await import('./index.X0nbfr6-.js').then(function (n) { return n.i; });
7564
7595
  const { projectName } = await prompts.default({
7565
7596
  type: "select",
7566
7597
  name: "projectName",
@@ -7878,7 +7909,8 @@ class VitestSpecifications {
7878
7909
  return specs;
7879
7910
  }
7880
7911
  const forceRerunTriggers = this.vitest.config.forceRerunTriggers;
7881
- if (forceRerunTriggers.length && mm(related, forceRerunTriggers).length) {
7912
+ const matcher = forceRerunTriggers.length ? pm(forceRerunTriggers) : undefined;
7913
+ if (matcher && related.some((file) => matcher(file))) {
7882
7914
  return specs;
7883
7915
  }
7884
7916
  if (!this.vitest.config.watch && !related.length) {
@@ -8719,7 +8751,7 @@ class VitestWatcher {
8719
8751
  if (this.changedTests.has(filepath) || this.invalidates.has(filepath)) {
8720
8752
  return false;
8721
8753
  }
8722
- if (mm.isMatch(filepath, this.vitest.config.forceRerunTriggers)) {
8754
+ if (pm.isMatch(filepath, this.vitest.config.forceRerunTriggers)) {
8723
8755
  this.vitest.state.getFilepaths().forEach((file) => this.changedTests.add(file));
8724
8756
  return true;
8725
8757
  }