vitest 1.6.0 → 2.0.0-beta.10

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 (74) hide show
  1. package/LICENSE.md +173 -1
  2. package/dist/browser.d.ts +22 -2
  3. package/dist/browser.js +6 -4
  4. package/dist/chunks/{environments-node.vcoXCoKs.js → environments-node.39w4gmlF.js} +2 -2
  5. package/dist/chunks/{install-pkg.LE8oaA1t.js → install-pkg.DNUmWFkO.js} +2 -2
  6. package/dist/chunks/integrations-globals.C6Ah-pUW.js +31 -0
  7. package/dist/chunks/{runtime-console.EO5ha7qv.js → runtime-console.DiVMr5d4.js} +62 -32
  8. package/dist/chunks/{runtime-runBaseTests.oAvMKtQC.js → runtime-runBaseTests.Cukyr5-I.js} +18 -18
  9. package/dist/cli.js +3 -3
  10. package/dist/config.cjs +4 -5
  11. package/dist/config.d.ts +2 -2
  12. package/dist/config.js +4 -5
  13. package/dist/coverage.d.ts +1 -1
  14. package/dist/coverage.js +34 -8
  15. package/dist/environments.d.ts +1 -1
  16. package/dist/environments.js +1 -1
  17. package/dist/execute.d.ts +3 -2
  18. package/dist/execute.js +2 -2
  19. package/dist/index.d.ts +777 -65
  20. package/dist/index.js +12 -12
  21. package/dist/node.d.ts +7 -7
  22. package/dist/node.js +24 -23
  23. package/dist/{reporters-yx5ZTtEV.d.ts → reporters-CYVC6LOl.d.ts} +439 -219
  24. package/dist/reporters.d.ts +1 -1
  25. package/dist/reporters.js +11 -12
  26. package/dist/runners.d.ts +4 -2
  27. package/dist/runners.js +25 -18
  28. package/dist/snapshot.js +3 -3
  29. package/dist/{suite-IbNSsUWN.d.ts → suite-Dpu9EC_k.d.ts} +1 -1
  30. package/dist/suite.d.ts +2 -2
  31. package/dist/suite.js +4 -4
  32. package/dist/vendor/{base.Ybri3C14.js → base.Dln9yllP.js} +3 -3
  33. package/dist/vendor/{base.5NT-gWu5.js → base._gnK9Slw.js} +1 -2
  34. package/dist/vendor/{benchmark.yGkUTKnC.js → benchmark.BNLebNi5.js} +1 -1
  35. package/dist/vendor/{cac.EdDItJD-.js → cac.CtYFkoSJ.js} +66 -25
  36. package/dist/vendor/{cli-api.E07AF1Yq.js → cli-api.CUtJc4r3.js} +11851 -7276
  37. package/dist/vendor/{constants.5J7I254_.js → constants.TCjCaw2D.js} +4 -3
  38. package/dist/vendor/{execute.fL3szUAI.js → execute.BHj6OMh4.js} +4 -4
  39. package/dist/vendor/{index.DpVgvm2P.js → index.B5SKBLvV.js} +5 -5
  40. package/dist/vendor/{index.Q04MCqDO.js → index.BOMEjpjj.js} +680 -160
  41. package/dist/vendor/{index.8bPxjt7g.js → index.BpSiYbpB.js} +5 -1
  42. package/dist/vendor/{index.xL8XjTLv.js → index.CThipSqB.js} +2538 -2525
  43. package/dist/vendor/{index.dI9lHwVn.js → index.D3hs2WiI.js} +8 -6
  44. package/dist/vendor/{index.SMVOaj7F.js → index._7XLd8Kd.js} +2 -2
  45. package/dist/vendor/{index.GVFv9dZ0.js → index.kpsSqFiz.js} +2 -1
  46. package/dist/vendor/{rpc.joBhAkyK.js → rpc.DRDE9Pu1.js} +2 -2
  47. package/dist/vendor/{run-once.Olz_Zkd8.js → run-once.DLomgGUH.js} +1 -1
  48. package/dist/vendor/{setup-common.8nJLd4ay.js → setup-common.DAu7t7mY.js} +2 -2
  49. package/dist/vendor/spy.Cf_4R5Oe.js +22 -0
  50. package/dist/vendor/{tasks.IknbGB2n.js → tasks.WC7M-K-v.js} +4 -1
  51. package/dist/vendor/{utils.dEtNIEgr.js → utils.YuQ3LT2a.js} +2 -2
  52. package/dist/vendor/{vi.YFlodzP_.js → vi.hATFzZbX.js} +124 -56
  53. package/dist/vendor/{vm.QEE48c0T.js → vm.Ow-X2mkS.js} +47 -59
  54. package/dist/worker.js +6 -6
  55. package/dist/workers/forks.js +5 -5
  56. package/dist/workers/runVmTests.js +17 -17
  57. package/dist/workers/threads.js +5 -5
  58. package/dist/workers/vmForks.js +8 -8
  59. package/dist/workers/vmThreads.js +8 -8
  60. package/dist/workers.d.ts +1 -1
  61. package/dist/workers.js +13 -13
  62. package/package.json +35 -35
  63. package/suppress-warnings.cjs +2 -1
  64. package/vitest.mjs +1 -1
  65. package/dist/chunks/integrations-globals.kw4co3rx.js +0 -31
  66. package/dist/cli-wrapper.js +0 -119
  67. /package/dist/chunks/{node-git.Hw101KjS.js → node-git.CCI8evVZ.js} +0 -0
  68. /package/dist/vendor/{_commonjsHelpers.jjO7Zipk.js → _commonjsHelpers.BFTU3MAI.js} +0 -0
  69. /package/dist/vendor/{coverage.E7sG1b3r.js → coverage.ChSqD-qS.js} +0 -0
  70. /package/dist/vendor/{date.Ns1pGd_X.js → date.BKM1wewY.js} +0 -0
  71. /package/dist/vendor/{env.AtSIuHFg.js → env.bmJgw1qP.js} +0 -0
  72. /package/dist/vendor/{global.CkGT_TMy.js → global.7bFbnyXl.js} +0 -0
  73. /package/dist/vendor/{inspector.IgLX3ur5.js → inspector.hPQncR7V.js} +0 -0
  74. /package/dist/vendor/{utils.0uYuCbzo.js → utils.CUjzkRH7.js} +0 -0
package/LICENSE.md CHANGED
@@ -196,6 +196,35 @@ Repository: https://github.com/sinonjs/fake-timers.git
196
196
 
197
197
  ---------------------------------------
198
198
 
199
+ ## acorn-walk
200
+ License: MIT
201
+ By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine
202
+ Repository: https://github.com/acornjs/acorn.git
203
+
204
+ > MIT License
205
+ >
206
+ > Copyright (C) 2012-2020 by various contributors (see AUTHORS)
207
+ >
208
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
209
+ > of this software and associated documentation files (the "Software"), to deal
210
+ > in the Software without restriction, including without limitation the rights
211
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
212
+ > copies of the Software, and to permit persons to whom the Software is
213
+ > furnished to do so, subject to the following conditions:
214
+ >
215
+ > The above copyright notice and this permission notice shall be included in
216
+ > all copies or substantial portions of the Software.
217
+ >
218
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
219
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
220
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
221
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
222
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
223
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
224
+ > THE SOFTWARE.
225
+
226
+ ---------------------------------------
227
+
199
228
  ## ansi-escapes
200
229
  License: MIT
201
230
  By: Sindre Sorhus
@@ -283,7 +312,7 @@ Repository: micromatch/braces
283
312
 
284
313
  > The MIT License (MIT)
285
314
  >
286
- > Copyright (c) 2014-2018, Jon Schlinkert.
315
+ > Copyright (c) 2014-present, Jon Schlinkert.
287
316
  >
288
317
  > Permission is hereby granted, free of charge, to any person obtaining a copy
289
318
  > of this software and associated documentation files (the "Software"), to deal
@@ -932,6 +961,35 @@ Repository: jonschlinkert/is-number
932
961
 
933
962
  ---------------------------------------
934
963
 
964
+ ## js-tokens
965
+ License: MIT
966
+ By: Simon Lydell
967
+ Repository: lydell/js-tokens
968
+
969
+ > The MIT License (MIT)
970
+ >
971
+ > Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Simon Lydell
972
+ >
973
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
974
+ > of this software and associated documentation files (the "Software"), to deal
975
+ > in the Software without restriction, including without limitation the rights
976
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
977
+ > copies of the Software, and to permit persons to whom the Software is
978
+ > furnished to do so, subject to the following conditions:
979
+ >
980
+ > The above copyright notice and this permission notice shall be included in
981
+ > all copies or substantial portions of the Software.
982
+ >
983
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
984
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
985
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
986
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
987
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
988
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
989
+ > THE SOFTWARE.
990
+
991
+ ---------------------------------------
992
+
935
993
  ## kleur
936
994
  License: MIT
937
995
  By: Luke Edwards
@@ -961,6 +1019,35 @@ Repository: lukeed/kleur
961
1019
 
962
1020
  ---------------------------------------
963
1021
 
1022
+ ## local-pkg
1023
+ License: MIT
1024
+ By: Anthony Fu
1025
+ Repository: git+https://github.com/antfu/local-pkg.git
1026
+
1027
+ > MIT License
1028
+ >
1029
+ > Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
1030
+ >
1031
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
1032
+ > of this software and associated documentation files (the "Software"), to deal
1033
+ > in the Software without restriction, including without limitation the rights
1034
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1035
+ > copies of the Software, and to permit persons to whom the Software is
1036
+ > furnished to do so, subject to the following conditions:
1037
+ >
1038
+ > The above copyright notice and this permission notice shall be included in all
1039
+ > copies or substantial portions of the Software.
1040
+ >
1041
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1042
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1043
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1044
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1045
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1046
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1047
+ > SOFTWARE.
1048
+
1049
+ ---------------------------------------
1050
+
964
1051
  ## locate-path
965
1052
  License: MIT
966
1053
  By: Sindre Sorhus
@@ -1069,6 +1156,34 @@ Repository: sindresorhus/mimic-fn
1069
1156
 
1070
1157
  ---------------------------------------
1071
1158
 
1159
+ ## mlly
1160
+ License: MIT
1161
+ Repository: unjs/mlly
1162
+
1163
+ > MIT License
1164
+ >
1165
+ > Copyright (c) Pooya Parsa <pooya@pi0.io>
1166
+ >
1167
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
1168
+ > of this software and associated documentation files (the "Software"), to deal
1169
+ > in the Software without restriction, including without limitation the rights
1170
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1171
+ > copies of the Software, and to permit persons to whom the Software is
1172
+ > furnished to do so, subject to the following conditions:
1173
+ >
1174
+ > The above copyright notice and this permission notice shall be included in all
1175
+ > copies or substantial portions of the Software.
1176
+ >
1177
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1178
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1179
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1180
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1181
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1182
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1183
+ > SOFTWARE.
1184
+
1185
+ ---------------------------------------
1186
+
1072
1187
  ## onetime
1073
1188
  License: MIT
1074
1189
  By: Sindre Sorhus
@@ -1413,6 +1528,35 @@ Repository: chalk/strip-ansi
1413
1528
 
1414
1529
  ---------------------------------------
1415
1530
 
1531
+ ## strip-literal
1532
+ License: MIT
1533
+ By: Anthony Fu
1534
+ Repository: git+https://github.com/antfu/strip-literal.git
1535
+
1536
+ > MIT License
1537
+ >
1538
+ > Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
1539
+ >
1540
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
1541
+ > of this software and associated documentation files (the "Software"), to deal
1542
+ > in the Software without restriction, including without limitation the rights
1543
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1544
+ > copies of the Software, and to permit persons to whom the Software is
1545
+ > furnished to do so, subject to the following conditions:
1546
+ >
1547
+ > The above copyright notice and this permission notice shall be included in all
1548
+ > copies or substantial portions of the Software.
1549
+ >
1550
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1551
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1552
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1553
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1554
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1555
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1556
+ > SOFTWARE.
1557
+
1558
+ ---------------------------------------
1559
+
1416
1560
  ## to-regex-range
1417
1561
  License: MIT
1418
1562
  By: Jon Schlinkert, Rouven Weßling
@@ -1469,6 +1613,34 @@ Repository: git+ssh://git@github.com/chaijs/type-detect.git
1469
1613
 
1470
1614
  ---------------------------------------
1471
1615
 
1616
+ ## ufo
1617
+ License: MIT
1618
+ Repository: unjs/ufo
1619
+
1620
+ > MIT License
1621
+ >
1622
+ > Copyright (c) Pooya Parsa <pooya@pi0.io>
1623
+ >
1624
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
1625
+ > of this software and associated documentation files (the "Software"), to deal
1626
+ > in the Software without restriction, including without limitation the rights
1627
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1628
+ > copies of the Software, and to permit persons to whom the Software is
1629
+ > furnished to do so, subject to the following conditions:
1630
+ >
1631
+ > The above copyright notice and this permission notice shall be included in all
1632
+ > copies or substantial portions of the Software.
1633
+ >
1634
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1635
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1636
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1637
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1638
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1639
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1640
+ > SOFTWARE.
1641
+
1642
+ ---------------------------------------
1643
+
1472
1644
  ## wrap-ansi
1473
1645
  License: MIT
1474
1646
  By: Sindre Sorhus
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { processError, startTests } from '@vitest/runner';
2
- import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-yx5ZTtEV.js';
2
+ import { R as ResolvedConfig, C as CoverageOptions, b as CoverageProvider, c as CoverageProviderModule } from './reporters-CYVC6LOl.js';
3
3
  import { VitestExecutor } from './execute.js';
4
+ import * as spy$1 from '@vitest/spy';
4
5
  import 'vite';
5
6
  import 'vite-node';
6
7
  import '@vitest/snapshot';
@@ -17,6 +18,25 @@ import 'node:fs';
17
18
  import 'chai';
18
19
  import 'node:vm';
19
20
 
21
+ function _mergeNamespaces(n, m) {
22
+ m.forEach(function (e) {
23
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default' && !(k in n)) {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ });
33
+ return Object.freeze(n);
34
+ }
35
+
36
+ var spy = /*#__PURE__*/_mergeNamespaces({
37
+ __proto__: null
38
+ }, [spy$1]);
39
+
20
40
  type Formatter = (input: string | number | null | undefined) => string;
21
41
 
22
42
  interface DiffOptions {
@@ -57,4 +77,4 @@ declare function startCoverageInsideWorker(options: CoverageOptions | undefined,
57
77
  declare function takeCoverageInsideWorker(options: CoverageOptions | undefined, loader: Loader): Promise<unknown>;
58
78
  declare function stopCoverageInsideWorker(options: CoverageOptions | undefined, loader: Loader): Promise<unknown>;
59
79
 
60
- export { getCoverageProvider, loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
80
+ export { spy as SpyModule, getCoverageProvider, loadDiffConfig, loadSnapshotSerializers, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, takeCoverageInsideWorker };
package/dist/browser.js CHANGED
@@ -1,7 +1,9 @@
1
1
  export { processError, startTests } from '@vitest/runner';
2
- export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.8nJLd4ay.js';
3
- export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.E7sG1b3r.js';
2
+ export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv } from './vendor/setup-common.DAu7t7mY.js';
3
+ export { g as getCoverageProvider, a as startCoverageInsideWorker, s as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './vendor/coverage.ChSqD-qS.js';
4
+ export { s as SpyModule } from './vendor/spy.Cf_4R5Oe.js';
4
5
  import '@vitest/utils';
5
6
  import '@vitest/snapshot';
6
- import './vendor/run-once.Olz_Zkd8.js';
7
- import './vendor/global.CkGT_TMy.js';
7
+ import './vendor/run-once.DLomgGUH.js';
8
+ import './vendor/global.7bFbnyXl.js';
9
+ import '@vitest/spy';
@@ -2,8 +2,8 @@ import { NodeSnapshotEnvironment } from '@vitest/snapshot/environment';
2
2
  import 'pathe';
3
3
  import '@vitest/runner/utils';
4
4
  import '@vitest/utils';
5
- import { g as getWorkerState } from '../vendor/global.CkGT_TMy.js';
6
- import '../vendor/env.AtSIuHFg.js';
5
+ import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
6
+ import '../vendor/env.bmJgw1qP.js';
7
7
  import 'std-env';
8
8
 
9
9
  class VitestNodeSnapshotEnvironment extends NodeSnapshotEnvironment {
@@ -25,12 +25,12 @@ var __privateAdd = (obj, member, value) => {
25
25
  };
26
26
  var __privateSet = (obj, member, value, setter) => {
27
27
  __accessCheck(obj, member, "write to private field");
28
- setter ? setter.call(obj, value) : member.set(obj, value);
28
+ member.set(obj, value);
29
29
  return value;
30
30
  };
31
31
  var __privateWrapper = (obj, member, setter, getter) => ({
32
32
  set _(value) {
33
- __privateSet(obj, member, value, setter);
33
+ __privateSet(obj, member, value);
34
34
  },
35
35
  get _() {
36
36
  return __privateGet(obj, member, getter);
@@ -0,0 +1,31 @@
1
+ import { g as globalApis } from '../vendor/constants.TCjCaw2D.js';
2
+ import { V as VitestIndex } from '../vendor/index.D3hs2WiI.js';
3
+ import '@vitest/runner';
4
+ import '../vendor/benchmark.BNLebNi5.js';
5
+ import '@vitest/runner/utils';
6
+ import '@vitest/utils';
7
+ import '../vendor/index._7XLd8Kd.js';
8
+ import 'pathe';
9
+ import '../vendor/global.7bFbnyXl.js';
10
+ import '../vendor/env.bmJgw1qP.js';
11
+ import 'std-env';
12
+ import '../vendor/run-once.DLomgGUH.js';
13
+ import '../vendor/vi.hATFzZbX.js';
14
+ import 'chai';
15
+ import '../vendor/_commonjsHelpers.BFTU3MAI.js';
16
+ import '@vitest/expect';
17
+ import '@vitest/snapshot';
18
+ import '@vitest/utils/error';
19
+ import '../vendor/tasks.WC7M-K-v.js';
20
+ import '@vitest/utils/source-map';
21
+ import '../vendor/base._gnK9Slw.js';
22
+ import '../vendor/date.BKM1wewY.js';
23
+ import '@vitest/spy';
24
+
25
+ function registerApiGlobally() {
26
+ globalApis.forEach((api) => {
27
+ globalThis[api] = VitestIndex[api];
28
+ });
29
+ }
30
+
31
+ export { registerApiGlobally };
@@ -2,11 +2,11 @@ import { Writable } from 'node:stream';
2
2
  import { Console } from 'node:console';
3
3
  import { relative } from 'node:path';
4
4
  import { getSafeTimers, getColors } from '@vitest/utils';
5
- import { R as RealDate } from '../vendor/date.Ns1pGd_X.js';
5
+ import { R as RealDate } from '../vendor/date.BKM1wewY.js';
6
6
  import 'pathe';
7
7
  import '@vitest/runner/utils';
8
- import { g as getWorkerState } from '../vendor/global.CkGT_TMy.js';
9
- import '../vendor/env.AtSIuHFg.js';
8
+ import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
9
+ import '../vendor/env.bmJgw1qP.js';
10
10
  import 'std-env';
11
11
 
12
12
  const UNKNOWN_TEST_ID = "__vitest__unknown_test__";
@@ -24,12 +24,12 @@ function getTaskIdByStack(root) {
24
24
  return relative(root, filepath);
25
25
  return UNKNOWN_TEST_ID;
26
26
  }
27
- function createCustomConsole() {
27
+ function createCustomConsole(defaultState) {
28
28
  const stdoutBuffer = /* @__PURE__ */ new Map();
29
29
  const stderrBuffer = /* @__PURE__ */ new Map();
30
30
  const timers = /* @__PURE__ */ new Map();
31
31
  const { setTimeout, clearTimeout } = getSafeTimers();
32
- const state = () => getWorkerState();
32
+ const state = () => defaultState || getWorkerState();
33
33
  function schedule(taskId) {
34
34
  const timer = timers.get(taskId);
35
35
  const { stdoutTime, stderrTime } = timer;
@@ -45,42 +45,48 @@ function createCustomConsole() {
45
45
  });
46
46
  }
47
47
  function sendStdout(taskId) {
48
- const buffer = stdoutBuffer.get(taskId);
49
- if (!buffer)
50
- return;
51
- const content = buffer.map((i) => String(i)).join("");
52
- const timer = timers.get(taskId);
53
- state().rpc.onUserConsoleLog({
54
- type: "stdout",
55
- content: content || "<empty line>",
56
- taskId,
57
- time: timer.stdoutTime || RealDate.now(),
58
- size: buffer.length
59
- });
60
- stdoutBuffer.set(taskId, []);
61
- timer.stdoutTime = 0;
48
+ sendBuffer("stdout", taskId);
62
49
  }
63
50
  function sendStderr(taskId) {
64
- const buffer = stderrBuffer.get(taskId);
51
+ sendBuffer("stderr", taskId);
52
+ }
53
+ function sendBuffer(type, taskId) {
54
+ const buffers = type === "stdout" ? stdoutBuffer : stderrBuffer;
55
+ const buffer = buffers.get(taskId);
65
56
  if (!buffer)
66
57
  return;
67
- const content = buffer.map((i) => String(i)).join("");
58
+ if (state().config.printConsoleTrace) {
59
+ buffer.forEach(([buffer2, origin]) => {
60
+ sendLog(type, taskId, String(buffer2), buffer2.length, origin);
61
+ });
62
+ } else {
63
+ const content = buffer.map((i) => String(i[0])).join("");
64
+ sendLog(type, taskId, content, buffer.length);
65
+ }
66
+ const timer = timers.get(taskId);
67
+ buffers.set(taskId, []);
68
+ if (type === "stderr")
69
+ timer.stderrTime = 0;
70
+ else
71
+ timer.stdoutTime = 0;
72
+ }
73
+ function sendLog(type, taskId, content, size, origin) {
68
74
  const timer = timers.get(taskId);
75
+ const time = type === "stderr" ? timer.stderrTime : timer.stdoutTime;
69
76
  state().rpc.onUserConsoleLog({
70
- type: "stderr",
77
+ type,
71
78
  content: content || "<empty line>",
72
79
  taskId,
73
- time: timer.stderrTime || RealDate.now(),
74
- size: buffer.length
80
+ time: time || RealDate.now(),
81
+ size,
82
+ origin
75
83
  });
76
- stderrBuffer.set(taskId, []);
77
- timer.stderrTime = 0;
78
84
  }
79
85
  const stdout = new Writable({
80
86
  write(data, encoding, callback) {
81
- var _a, _b, _c;
87
+ var _a, _b, _c, _d;
82
88
  const s = state();
83
- const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.file) == null ? void 0 : _c.id) || getTaskIdByStack(s.config.root);
89
+ const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.suite) == null ? void 0 : _c.id) || ((_d = s.current) == null ? void 0 : _d.file.id) || getTaskIdByStack(s.config.root);
84
90
  let timer = timers.get(id);
85
91
  if (timer) {
86
92
  timer.stdoutTime = timer.stdoutTime || RealDate.now();
@@ -93,16 +99,25 @@ function createCustomConsole() {
93
99
  buffer = [];
94
100
  stdoutBuffer.set(id, buffer);
95
101
  }
96
- buffer.push(data);
102
+ if (state().config.printConsoleTrace) {
103
+ const limit = Error.stackTraceLimit;
104
+ Error.stackTraceLimit = limit + 6;
105
+ const stack = new Error("STACK_TRACE").stack;
106
+ const trace = stack == null ? void 0 : stack.split("\n").slice(7).join("\n");
107
+ Error.stackTraceLimit = limit;
108
+ buffer.push([data, trace]);
109
+ } else {
110
+ buffer.push([data, void 0]);
111
+ }
97
112
  schedule(id);
98
113
  callback();
99
114
  }
100
115
  });
101
116
  const stderr = new Writable({
102
117
  write(data, encoding, callback) {
103
- var _a, _b, _c;
118
+ var _a, _b, _c, _d, _e;
104
119
  const s = state();
105
- const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.file) == null ? void 0 : _c.id) || getTaskIdByStack(s.config.root);
120
+ const id = ((_a = s == null ? void 0 : s.current) == null ? void 0 : _a.id) || ((_c = (_b = s == null ? void 0 : s.current) == null ? void 0 : _b.suite) == null ? void 0 : _c.id) || ((_d = s.current) == null ? void 0 : _d.file.id) || getTaskIdByStack(s.config.root);
106
121
  let timer = timers.get(id);
107
122
  if (timer) {
108
123
  timer.stderrTime = timer.stderrTime || RealDate.now();
@@ -115,7 +130,22 @@ function createCustomConsole() {
115
130
  buffer = [];
116
131
  stderrBuffer.set(id, buffer);
117
132
  }
118
- buffer.push(data);
133
+ if (state().config.printConsoleTrace) {
134
+ const limit = Error.stackTraceLimit;
135
+ Error.stackTraceLimit = limit + 6;
136
+ const stack = (_e = new Error("STACK_TRACE").stack) == null ? void 0 : _e.split("\n");
137
+ Error.stackTraceLimit = limit;
138
+ const isTrace = stack == null ? void 0 : stack.some((line) => line.includes("at Console.trace"));
139
+ if (isTrace) {
140
+ buffer.push([data, void 0]);
141
+ } else {
142
+ const trace = stack == null ? void 0 : stack.slice(7).join("\n");
143
+ Error.stackTraceLimit = limit;
144
+ buffer.push([data, trace]);
145
+ }
146
+ } else {
147
+ buffer.push([data, void 0]);
148
+ }
119
149
  schedule(id);
120
150
  callback();
121
151
  }
@@ -3,37 +3,37 @@ import { startTests } from '@vitest/runner';
3
3
  import 'pathe';
4
4
  import '@vitest/runner/utils';
5
5
  import { setupColors, createColors, getSafeTimers } from '@vitest/utils';
6
- import { g as getWorkerState } from '../vendor/global.CkGT_TMy.js';
7
- import '../vendor/env.AtSIuHFg.js';
8
- import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.YFlodzP_.js';
9
- import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.E7sG1b3r.js';
10
- import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.DpVgvm2P.js';
6
+ import { g as getWorkerState } from '../vendor/global.7bFbnyXl.js';
7
+ import '../vendor/env.bmJgw1qP.js';
8
+ import { a as globalExpect, r as resetModules, v as vi } from '../vendor/vi.hATFzZbX.js';
9
+ import { a as startCoverageInsideWorker, s as stopCoverageInsideWorker } from '../vendor/coverage.ChSqD-qS.js';
10
+ import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from '../vendor/index.B5SKBLvV.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 { isatty } from 'node:tty';
15
15
  import { installSourcemapsSupport } from 'vite-node/source-map';
16
- import { V as VitestIndex } from '../vendor/index.dI9lHwVn.js';
17
- import { s as setupCommonEnv } from '../vendor/setup-common.8nJLd4ay.js';
18
- import { c as closeInspector } from '../vendor/inspector.IgLX3ur5.js';
16
+ import { V as VitestIndex } from '../vendor/index.D3hs2WiI.js';
17
+ import { s as setupCommonEnv } from '../vendor/setup-common.DAu7t7mY.js';
18
+ import { c as closeInspector } from '../vendor/inspector.hPQncR7V.js';
19
19
  import 'std-env';
20
20
  import 'chai';
21
- import '../vendor/_commonjsHelpers.jjO7Zipk.js';
21
+ import '../vendor/_commonjsHelpers.BFTU3MAI.js';
22
22
  import '@vitest/expect';
23
23
  import '@vitest/snapshot';
24
24
  import '@vitest/utils/error';
25
- import '../vendor/tasks.IknbGB2n.js';
25
+ import '../vendor/tasks.WC7M-K-v.js';
26
26
  import '@vitest/utils/source-map';
27
- import '../vendor/base.5NT-gWu5.js';
28
- import '../vendor/date.Ns1pGd_X.js';
27
+ import '../vendor/base._gnK9Slw.js';
28
+ import '../vendor/date.BKM1wewY.js';
29
29
  import '@vitest/spy';
30
30
  import '../path.js';
31
31
  import 'node:url';
32
- import '../vendor/rpc.joBhAkyK.js';
33
- import '../vendor/index.8bPxjt7g.js';
34
- import '../vendor/benchmark.yGkUTKnC.js';
35
- import '../vendor/index.SMVOaj7F.js';
36
- import '../vendor/run-once.Olz_Zkd8.js';
32
+ import '../vendor/rpc.DRDE9Pu1.js';
33
+ import '../vendor/index.BpSiYbpB.js';
34
+ import '../vendor/benchmark.BNLebNi5.js';
35
+ import '../vendor/index._7XLd8Kd.js';
36
+ import '../vendor/run-once.DLomgGUH.js';
37
37
 
38
38
  let globalSetup = false;
39
39
  async function setupGlobalEnv(config, { environment }, executor) {
@@ -70,7 +70,7 @@ async function setupGlobalEnv(config, { environment }, executor) {
70
70
  await setupConsoleLogSpy();
71
71
  }
72
72
  async function setupConsoleLogSpy() {
73
- const { createCustomConsole } = await import('./runtime-console.EO5ha7qv.js');
73
+ const { createCustomConsole } = await import('./runtime-console.DiVMr5d4.js');
74
74
  globalThis.console = createCustomConsole();
75
75
  }
76
76
  async function withEnv({ environment }, options, fn) {
package/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
1
- import { c as createCLI } from './vendor/cac.EdDItJD-.js';
1
+ import { c as createCLI } from './vendor/cac.CtYFkoSJ.js';
2
2
  import 'pathe';
3
3
  import 'events';
4
4
  import 'picocolors';
5
- import './vendor/base.5NT-gWu5.js';
5
+ import './vendor/base._gnK9Slw.js';
6
6
  import '@vitest/utils';
7
- import './vendor/constants.5J7I254_.js';
7
+ import './vendor/constants.TCjCaw2D.js';
8
8
 
9
9
  createCLI().parse();
package/dist/config.cjs CHANGED
@@ -41,7 +41,7 @@ const coverageConfigDefaults = {
41
41
  reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
42
42
  extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
43
43
  allowExternal: false,
44
- ignoreEmptyLines: false,
44
+ ignoreEmptyLines: true,
45
45
  processingConcurrency: Math.min(20, ((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length)
46
46
  };
47
47
  const fakeTimersDefaults = {
@@ -63,7 +63,7 @@ const config = {
63
63
  watch: !stdEnv.isCI,
64
64
  globals: false,
65
65
  environment: "node",
66
- pool: "threads",
66
+ pool: "forks",
67
67
  clearMocks: false,
68
68
  restoreMocks: false,
69
69
  mockReset: false,
@@ -72,7 +72,6 @@ const config = {
72
72
  testTimeout: 5e3,
73
73
  hookTimeout: 1e4,
74
74
  teardownTimeout: 1e4,
75
- watchExclude: ["**/node_modules/**", "**/dist/**"],
76
75
  forceRerunTriggers: [
77
76
  "**/package.json/**",
78
77
  "**/{vitest,vite}.config.*/**"
@@ -103,8 +102,8 @@ const config = {
103
102
  const configDefaults = Object.freeze(config);
104
103
 
105
104
  const extraInlineDeps = [
106
- /^(?!.*(?:node_modules)).*\.mjs$/,
107
- /^(?!.*(?:node_modules)).*\.cjs\.js$/,
105
+ /^(?!.*node_modules).*\.mjs$/,
106
+ /^(?!.*node_modules).*\.cjs\.js$/,
108
107
  // Vite client
109
108
  /vite\w*\/dist\/client\/env.mjs/,
110
109
  // Nuxt
package/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { ConfigEnv, UserConfig, mergeConfig } from 'vite';
2
- export { ax as UserConfigExport, aw as UserConfigFn, au as UserConfigFnObject, av as UserConfigFnPromise, az as UserProjectConfigExport, ay as UserProjectConfigFn, a1 as UserWorkspaceConfig, aD as configDefaults, aG as coverageConfigDefaults, aF as defaultExclude, aE as defaultInclude, aA as defineConfig, aB as defineProject, aC as defineWorkspace, aH as extraInlineDeps } from './reporters-yx5ZTtEV.js';
1
+ export { ConfigEnv, Plugin, UserConfig, mergeConfig } from 'vite';
2
+ export { aL as UserConfigExport, aK as UserConfigFn, aI as UserConfigFnObject, aJ as UserConfigFnPromise, aN as UserProjectConfigExport, aM as UserProjectConfigFn, y as UserWorkspaceConfig, aR as configDefaults, aU as coverageConfigDefaults, aT as defaultExclude, aS as defaultInclude, aO as defineConfig, aP as defineProject, aQ as defineWorkspace, aV as extraInlineDeps } from './reporters-CYVC6LOl.js';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';
5
5
  import '@vitest/snapshot';
package/dist/config.js CHANGED
@@ -39,7 +39,7 @@ const coverageConfigDefaults = {
39
39
  reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
40
40
  extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte", ".marko"],
41
41
  allowExternal: false,
42
- ignoreEmptyLines: false,
42
+ ignoreEmptyLines: true,
43
43
  processingConcurrency: Math.min(20, ((_b = (_a = os).availableParallelism) == null ? void 0 : _b.call(_a)) ?? os.cpus().length)
44
44
  };
45
45
  const fakeTimersDefaults = {
@@ -61,7 +61,7 @@ const config = {
61
61
  watch: !isCI,
62
62
  globals: false,
63
63
  environment: "node",
64
- pool: "threads",
64
+ pool: "forks",
65
65
  clearMocks: false,
66
66
  restoreMocks: false,
67
67
  mockReset: false,
@@ -70,7 +70,6 @@ const config = {
70
70
  testTimeout: 5e3,
71
71
  hookTimeout: 1e4,
72
72
  teardownTimeout: 1e4,
73
- watchExclude: ["**/node_modules/**", "**/dist/**"],
74
73
  forceRerunTriggers: [
75
74
  "**/package.json/**",
76
75
  "**/{vitest,vite}.config.*/**"
@@ -101,8 +100,8 @@ const config = {
101
100
  const configDefaults = Object.freeze(config);
102
101
 
103
102
  const extraInlineDeps = [
104
- /^(?!.*(?:node_modules)).*\.mjs$/,
105
- /^(?!.*(?:node_modules)).*\.cjs\.js$/,
103
+ /^(?!.*node_modules).*\.mjs$/,
104
+ /^(?!.*node_modules).*\.cjs\.js$/,
106
105
  // Vite client
107
106
  /vite\w*\/dist\/client\/env.mjs/,
108
107
  // Nuxt
@@ -1,4 +1,4 @@
1
- import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-yx5ZTtEV.js';
1
+ import { B as BaseCoverageOptions, a as ResolvedCoverageOptions } from './reporters-CYVC6LOl.js';
2
2
  import 'vite';
3
3
  import '@vitest/runner';
4
4
  import 'vite-node';