@voidzero-dev/vite-plus-test 0.1.9 → 0.1.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 (205) hide show
  1. package/LICENSE.md +181 -1
  2. package/dist/@vitest/browser/client/.vite/manifest.json +6 -6
  3. package/dist/@vitest/browser/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
  4. package/dist/@vitest/browser/client/__vitest__/assets/index-Di71CKDo.js +63 -0
  5. package/dist/@vitest/browser/client/__vitest__/favicon.ico +0 -0
  6. package/dist/@vitest/browser/client/__vitest__/favicon.svg +49 -4
  7. package/dist/@vitest/browser/client/__vitest__/index.html +2 -2
  8. package/dist/@vitest/browser/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
  9. package/dist/@vitest/browser/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +167 -58
  10. package/dist/@vitest/browser/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
  11. package/dist/@vitest/browser/client/favicon.svg +49 -4
  12. package/dist/@vitest/browser/client/orchestrator.html +2 -2
  13. package/dist/@vitest/browser/client/tester/tester.html +2 -2
  14. package/dist/@vitest/browser/client.js +20 -13
  15. package/dist/@vitest/browser/context.d.ts +160 -10
  16. package/dist/@vitest/browser/context.js +108 -22
  17. package/dist/@vitest/browser/expect-element.js +23 -28
  18. package/dist/@vitest/browser/index-5Pe7X7sp.js +7 -0
  19. package/dist/@vitest/browser/index.d.ts +20 -2
  20. package/dist/@vitest/browser/index.js +5706 -159
  21. package/dist/@vitest/browser/locators.d.ts +14 -3
  22. package/dist/@vitest/browser/locators.js +1 -1
  23. package/dist/@vitest/browser-playwright/index.d.ts +22 -5
  24. package/dist/@vitest/browser-playwright/index.js +169 -61
  25. package/dist/@vitest/browser-preview/index.d.ts +14 -1
  26. package/dist/@vitest/browser-preview/locators.js +31 -18
  27. package/dist/@vitest/browser-webdriverio/index.d.ts +17 -3
  28. package/dist/@vitest/browser-webdriverio/index.js +22 -2
  29. package/dist/@vitest/browser-webdriverio/locators.js +84 -7
  30. package/dist/@vitest/expect/index.d.ts +172 -54
  31. package/dist/@vitest/expect/index.js +124 -67
  32. package/dist/@vitest/mocker/auto-register.js +1 -0
  33. package/dist/@vitest/mocker/automock.d.ts +1 -0
  34. package/dist/@vitest/mocker/automock.js +5 -0
  35. package/dist/@vitest/mocker/browser.d.ts +4 -4
  36. package/dist/@vitest/mocker/browser.js +1 -0
  37. package/dist/@vitest/mocker/chunk-automock.js +182 -14
  38. package/dist/@vitest/mocker/chunk-helpers.js +44 -0
  39. package/dist/@vitest/mocker/chunk-hoistMocks.js +659 -0
  40. package/dist/@vitest/mocker/chunk-mocker.js +41 -30
  41. package/dist/@vitest/mocker/chunk-registry.js +21 -7
  42. package/dist/@vitest/mocker/chunk-utils.js +18 -7
  43. package/dist/@vitest/mocker/hoistMocks.d-w2ILr1dG.d.ts +739 -0
  44. package/dist/@vitest/mocker/{index.d-C-sLYZi-.d.ts → index.d-B41z0AuW.d.ts} +1 -1
  45. package/dist/@vitest/mocker/index.d.ts +2 -2
  46. package/dist/@vitest/mocker/index.js +18 -3
  47. package/dist/@vitest/mocker/{mocker.d-TnKRhz7N.d.ts → mocker.d-QEntlm6J.d.ts} +10 -5
  48. package/dist/@vitest/mocker/node.d.ts +5 -734
  49. package/dist/@vitest/mocker/node.js +29 -587
  50. package/dist/@vitest/mocker/redirect.js +4 -4
  51. package/dist/@vitest/mocker/register.d.ts +3 -3
  52. package/dist/@vitest/mocker/register.js +1 -0
  53. package/dist/@vitest/mocker/transforms.d.ts +6 -0
  54. package/dist/@vitest/mocker/transforms.js +8 -0
  55. package/dist/@vitest/mocker/{types.d-B8CCKmHt.d.ts → types.d-BjI5eAwu.d.ts} +23 -7
  56. package/dist/@vitest/pretty-format/index.d.ts +11 -1
  57. package/dist/@vitest/pretty-format/index.js +33 -4
  58. package/dist/@vitest/runner/chunk-tasks.js +305 -37
  59. package/dist/@vitest/runner/index.d.ts +5 -6
  60. package/dist/@vitest/runner/index.js +1146 -455
  61. package/dist/@vitest/runner/{tasks.d-C7UxawJ9.d.ts → tasks.d-D2GKpdwQ.d.ts} +726 -55
  62. package/dist/@vitest/runner/types.d.ts +2 -182
  63. package/dist/@vitest/runner/utils.d.ts +16 -8
  64. package/dist/@vitest/runner/utils.js +1 -1
  65. package/dist/@vitest/snapshot/{environment.d-DHdQ1Csl.d.ts → environment.d-DOJxxZV9.d.ts} +2 -7
  66. package/dist/@vitest/snapshot/environment.d.ts +2 -1
  67. package/dist/@vitest/snapshot/environment.js +1 -1
  68. package/dist/@vitest/snapshot/index.d.ts +4 -3
  69. package/dist/@vitest/snapshot/index.js +21 -550
  70. package/dist/@vitest/snapshot/manager.d.ts +3 -2
  71. package/dist/@vitest/snapshot/manager.js +1 -1
  72. package/dist/@vitest/snapshot/{rawSnapshot.d-lFsMJFUd.d.ts → rawSnapshot.d-U2kJUxDr.d.ts} +1 -1
  73. package/dist/@vitest/spy/index.d.ts +34 -4
  74. package/dist/@vitest/spy/index.js +69 -19
  75. package/dist/@vitest/utils/diff.js +11 -9
  76. package/dist/@vitest/utils/display.d.ts +2 -1
  77. package/dist/@vitest/utils/display.js +38 -5
  78. package/dist/@vitest/utils/error.d.ts +2 -1
  79. package/dist/@vitest/utils/error.js +1 -2
  80. package/dist/@vitest/utils/helpers.d.ts +4 -1
  81. package/dist/@vitest/utils/helpers.js +43 -1
  82. package/dist/@vitest/utils/resolver.js +1 -2
  83. package/dist/@vitest/utils/serialize.js +6 -6
  84. package/dist/@vitest/utils/source-map/node.d.ts +6 -0
  85. package/dist/@vitest/utils/source-map/node.js +23 -0
  86. package/dist/@vitest/utils/source-map.js +15 -5
  87. package/dist/browser.d.ts +3 -2
  88. package/dist/browser.js +2 -2
  89. package/dist/chunks/acorn.B2iPLyUM.js +5958 -0
  90. package/dist/chunks/{base.CJ0Y4ePK.js → base.DM0-RqVb.js} +54 -16
  91. package/dist/chunks/{benchmark.B3N2zMcH.js → benchmark.D0SlKNbZ.js} +1 -1
  92. package/dist/chunks/{browser.d.ChKACdzH.d.ts → browser.d.X3SXoOCV.d.ts} +4 -1
  93. package/dist/chunks/{cac.DVeoLl0M.js → cac.CWGDZnXT.js} +979 -20
  94. package/dist/chunks/{cli-api.B7PN_QUv.js → cli-api.DuT9iuvY.js} +8764 -7898
  95. package/dist/chunks/{config.d.Cy95HiCx.d.ts → config.d.EJLVE3es.d.ts} +30 -15
  96. package/dist/chunks/{console.Cf-YriPC.js → console.3WNpx0tS.js} +3 -2
  97. package/dist/chunks/{constants.D_Q9UYh-.js → constants.CPYnjOGj.js} +4 -2
  98. package/dist/chunks/coverage.Bri33R1t.js +1050 -0
  99. package/dist/chunks/{creator.DAmOKTvJ.js → creator.DgVhQm5q.js} +35 -4
  100. package/dist/chunks/{defaults.BOqNVLsY.js → defaults.CdU2lD-q.js} +4 -3
  101. package/dist/chunks/{global.d.B15mdLcR.d.ts → global.d.x-ILCfAE.d.ts} +1 -2
  102. package/dist/chunks/{globals.DOayXfHP.js → globals.BXNGLnTL.js} +11 -10
  103. package/dist/chunks/{coverage.AVPTjMgw.js → index.BCY_7LL2.js} +5 -959
  104. package/dist/chunks/{index.C5r1PdPD.js → index.CEzQDJGb.js} +1 -1
  105. package/dist/chunks/{index.D3XRDfWc.js → index.CMESou6r.js} +26 -1
  106. package/dist/chunks/{index.6Qv1eEA6.js → index.DGNSnENe.js} +95 -9
  107. package/dist/chunks/{index.M8mOzt4Y.js → index.DXMFO5MJ.js} +3279 -2914
  108. package/dist/chunks/{index.Z5E_ObnR.js → index.DlDSLQD3.js} +7 -3
  109. package/dist/chunks/{index.CyBMJtT7.js → index.EY6TCHpo.js} +10 -8
  110. package/dist/chunks/{index.D4KonVSU.js → index.og1WyBLx.js} +18 -3
  111. package/dist/chunks/{init-forks._y3TW739.js → init-forks.DeArv0jT.js} +1 -1
  112. package/dist/chunks/{init-threads.DBO2kn-p.js → init-threads.-2OUl4Nn.js} +1 -1
  113. package/dist/chunks/{init.B6MLFIaN.js → init.DICorXCo.js} +52 -13
  114. package/dist/chunks/native.DPzPHdi5.js +148 -0
  115. package/dist/chunks/nativeModuleMocker.DndvSdL6.js +206 -0
  116. package/dist/chunks/nativeModuleRunner.BIakptoF.js +36 -0
  117. package/dist/chunks/{node.Ce0vMQM7.js → node.COQbm6gK.js} +1 -1
  118. package/dist/chunks/{plugin.d.CtqpEehP.d.ts → plugin.d.BuW-flqo.d.ts} +1 -1
  119. package/dist/chunks/{reporters.d.CWXNI2jG.d.ts → reporters.d.DVUYHHhe.d.ts} +328 -79
  120. package/dist/chunks/rpc.MzXet3jl.js +144 -0
  121. package/dist/chunks/{rpc.d.RH3apGEf.d.ts → rpc.d.BFMWpdph.d.ts} +10 -2
  122. package/dist/chunks/{setup-common.Cm-kSBVi.js → setup-common.B41N_kPE.js} +3 -3
  123. package/dist/chunks/{startModuleRunner.DEj0jb3e.js → startVitestModuleRunner.C3ZR-4J3.js} +265 -405
  124. package/dist/chunks/{suite.d.BJWk38HB.d.ts → suite.d.udJtyAgw.d.ts} +1 -1
  125. package/dist/chunks/{vi.2VT5v0um.js → test.CTcmp4Su.js} +538 -181
  126. package/dist/chunks/{utils.DvEY5TfP.js → utils.BX5Fg8C4.js} +8 -1
  127. package/dist/chunks/{vm.D3epNOPZ.js → vm.Dh2rTtmP.js} +48 -8
  128. package/dist/chunks/{worker.d.Dyxm8DEL.d.ts → worker.d.B84sVRy0.d.ts} +2 -2
  129. package/dist/cli.js +6 -5
  130. package/dist/client/.vite/manifest.json +6 -6
  131. package/dist/client/__vitest__/assets/index-Da0hb3oU.css +1 -0
  132. package/dist/client/__vitest__/assets/index-Di71CKDo.js +63 -0
  133. package/dist/client/__vitest__/favicon.ico +0 -0
  134. package/dist/client/__vitest__/favicon.svg +49 -4
  135. package/dist/client/__vitest__/index.html +2 -2
  136. package/dist/client/__vitest_browser__/{orchestrator-S_3e_uzt.js → orchestrator-CXs6qrFe.js} +70 -28
  137. package/dist/client/__vitest_browser__/{tester-k74mgIRa.js → tester-K5NNxh1O.js} +167 -58
  138. package/dist/client/__vitest_browser__/{utils-uxqdqUz8.js → utils-C2ISqq1C.js} +2 -2
  139. package/dist/client/favicon.svg +49 -4
  140. package/dist/client/orchestrator.html +2 -2
  141. package/dist/client/tester/tester.html +2 -2
  142. package/dist/client.js +20 -13
  143. package/dist/config.cjs +3 -2
  144. package/dist/config.d.ts +13 -12
  145. package/dist/config.js +2 -2
  146. package/dist/context.js +108 -22
  147. package/dist/coverage.d.ts +12 -8
  148. package/dist/coverage.js +8 -5
  149. package/dist/environments.js +3 -1
  150. package/dist/expect-element.js +23 -23
  151. package/dist/index-5Pe7X7sp.js +7 -0
  152. package/dist/index.d.ts +66 -27
  153. package/dist/index.js +10 -9
  154. package/dist/locators.d.ts +14 -3
  155. package/dist/locators.js +1 -1
  156. package/dist/module-evaluator.d.ts +11 -1
  157. package/dist/module-evaluator.js +43 -26
  158. package/dist/node.d.ts +28 -14
  159. package/dist/node.js +42 -40
  160. package/dist/nodejs-worker-loader.js +41 -0
  161. package/dist/plugins/mocker-transforms.mjs +2 -0
  162. package/dist/plugins/utils-source-map-node.mjs +2 -0
  163. package/dist/reporters.d.ts +8 -8
  164. package/dist/reporters.js +7 -5
  165. package/dist/runners.d.ts +24 -5
  166. package/dist/runners.js +6 -6
  167. package/dist/runtime.d.ts +6 -0
  168. package/dist/runtime.js +35 -0
  169. package/dist/snapshot.js +4 -2
  170. package/dist/suite.d.ts +1 -1
  171. package/dist/suite.js +4 -2
  172. package/dist/vendor/blazediff_core.d.mts +1 -0
  173. package/dist/vendor/blazediff_core.mjs +117 -0
  174. package/dist/vendor/chai.mjs +4 -249
  175. package/dist/vendor/convert-source-map.d.mts +1 -0
  176. package/dist/vendor/convert-source-map.mjs +150 -0
  177. package/dist/vendor/expect-type.d.mts +14 -7
  178. package/dist/vendor/expect-type.mjs +5 -5
  179. package/dist/vendor/std-env.d.mts +131 -40
  180. package/dist/vendor/std-env.mjs +114 -117
  181. package/dist/worker.d.ts +6 -6
  182. package/dist/worker.js +27 -21
  183. package/dist/workers/forks.js +23 -17
  184. package/dist/workers/runVmTests.js +18 -16
  185. package/dist/workers/threads.js +23 -17
  186. package/dist/workers/vmForks.js +15 -12
  187. package/dist/workers/vmThreads.js +15 -12
  188. package/globals.d.ts +2 -0
  189. package/package.json +35 -26
  190. package/suppress-warnings.cjs +1 -0
  191. package/dist/@vitest/browser/client/__vitest__/assets/index-BUCFJtth.js +0 -57
  192. package/dist/@vitest/browser/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
  193. package/dist/@vitest/browser/index-D6m36C6U.js +0 -11
  194. package/dist/@vitest/utils/chunk-_commonjsHelpers.js +0 -5
  195. package/dist/@vitest/utils/highlight.d.ts +0 -9
  196. package/dist/@vitest/utils/highlight.js +0 -538
  197. package/dist/chunks/date.Bq6ZW5rf.js +0 -73
  198. package/dist/chunks/rpc.BoxB0q7B.js +0 -76
  199. package/dist/chunks/test.B8ej_ZHS.js +0 -254
  200. package/dist/client/__vitest__/assets/index-BUCFJtth.js +0 -57
  201. package/dist/client/__vitest__/assets/index-DlhE0rqZ.css +0 -1
  202. package/dist/index-D6m36C6U.js +0 -6
  203. package/dist/mocker.d.ts +0 -1
  204. package/dist/mocker.js +0 -1
  205. package/dist/module-runner.js +0 -17
@@ -1,8 +1,8 @@
1
- import { c as resolve, m as moduleRunner, d as getWorkerState, g as getBrowserState, e as getTestName, a as getConfig } from "./utils-uxqdqUz8.js";
1
+ import { c as resolve, m as moduleRunner, d as getWorkerState, g as getBrowserState, e as getTestName, a as getConfig } from "./utils-C2ISqq1C.js";
2
2
  import { onCancel, globalChannel, channel, client } from '../../client.js';
3
3
  import { userEvent, page, server } from 'vitest/browser';
4
4
  import { getSafeTimers, DecodedMap as DecodedMap$1, getOriginalPosition as getOriginalPosition$1, loadDiffConfig, loadSnapshotSerializers, takeCoverageInsideWorker, browserFormat, Traces, setupCommonEnv, startCoverageInsideWorker, stopCoverageInsideWorker, startTests, collectTests, SpyModule } from '../../../../browser.js';
5
- import { VitestTestRunner, NodeBenchmarkRunner } from '../../../../runners.js';
5
+ import { TestRunner, BenchmarkRunner, recordArtifact } from '../../../../index.js';
6
6
  const scriptRel = "modulepreload";
7
7
  const assetsURL = function(dep) {
8
8
  return "/" + dep;
@@ -66,8 +66,7 @@ const object = "object";
66
66
  const noop = (_, value) => value;
67
67
  const primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
68
68
  const Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
69
- const revive = (input, parsed, output, $) => {
70
- const lazy = [];
69
+ const resolver = (input, lazy, parsed, $) => (output) => {
71
70
  for (let ke = keys(output), { length } = ke, y = 0; y < length; y++) {
72
71
  const k = ke[y];
73
72
  const value = output[k];
@@ -76,24 +75,29 @@ const revive = (input, parsed, output, $) => {
76
75
  if (typeof tmp === object && !parsed.has(tmp)) {
77
76
  parsed.add(tmp);
78
77
  output[k] = ignore;
79
- lazy.push({ k, a: [input, parsed, tmp, $] });
78
+ lazy.push({ o: output, k, r: tmp });
80
79
  } else
81
80
  output[k] = $.call(output, k, tmp);
82
81
  } else if (output[k] !== ignore)
83
82
  output[k] = $.call(output, k, value);
84
83
  }
85
- for (let { length } = lazy, i = 0; i < length; i++) {
86
- const { k, a } = lazy[i];
87
- output[k] = $.call(output, k, revive.apply(null, a));
88
- }
89
84
  return output;
90
85
  };
91
86
  const parse = (text, reviver) => {
92
87
  const input = $parse(text, Primitives).map(primitives);
93
- const value = input[0];
94
88
  const $ = noop;
95
- const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
96
- return $.call({ "": tmp }, "", tmp);
89
+ let value = input[0];
90
+ if (typeof value === object && value) {
91
+ const lazy = [];
92
+ const revive = resolver(input, lazy, /* @__PURE__ */ new Set(), $);
93
+ value = revive(value);
94
+ let i = 0;
95
+ while (i < lazy.length) {
96
+ const { o, k, r } = lazy[i++];
97
+ o[k] = $.call(o, k, revive(r));
98
+ }
99
+ }
100
+ return $.call({ "": value }, "", value);
97
101
  };
98
102
  function showPopupWarning(name, value, defaultValue) {
99
103
  return (...params) => {
@@ -562,8 +566,11 @@ const stackIgnorePatterns = [
562
566
  /node:\w+/,
563
567
  /__vitest_test__/,
564
568
  /__vitest_browser__/,
569
+ "/@id/__x00__vitest/browser",
565
570
  /\/deps\/vitest_/
566
571
  ];
572
+ const NOW_LENGTH = Date.now().toString().length;
573
+ const REGEXP_VITEST = new RegExp(`vitest=\\d{${NOW_LENGTH}}`);
567
574
  function extractLocation(urlLike) {
568
575
  if (!urlLike.includes(":")) {
569
576
  return [urlLike];
@@ -587,6 +594,9 @@ function extractLocation(urlLike) {
587
594
  const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url2);
588
595
  url2 = url2.slice(isWindows ? 5 : 4);
589
596
  }
597
+ if (url2.includes("vitest=")) {
598
+ url2 = url2.replace(REGEXP_VITEST, "").replace(/[?&]$/, "");
599
+ }
590
600
  return [url2, parts[2] || void 0, parts[3] || void 0];
591
601
  }
592
602
  function parseSingleFFOrSafariStack(raw) {
@@ -658,7 +668,7 @@ function parseSingleV8Stack(raw) {
658
668
  }
659
669
  file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
660
670
  if (method) {
661
- method = method.replace(/__vite_ssr_import_\d+__\./g, "").replace(/(Object\.)?__vite_ssr_export_default__\s?/g, "");
671
+ method = method.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/(Object\.)?__vite_ssr_export_default__\s?/g, "");
662
672
  }
663
673
  return {
664
674
  method,
@@ -678,7 +688,11 @@ function createStackString(stacks) {
678
688
  }
679
689
  function parseStacktrace(stack, options = {}) {
680
690
  const { ignoreStackEntries = stackIgnorePatterns } = options;
681
- const stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
691
+ let stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
692
+ const helperIndex = stacks.findLastIndex((s) => s.method === "__VITEST_HELPER__" || s.method === "async*__VITEST_HELPER__");
693
+ if (helperIndex >= 0) {
694
+ stacks = stacks.slice(helperIndex + 1);
695
+ }
682
696
  return stacks.map((stack2) => {
683
697
  var _a;
684
698
  if (options.getUrlId) {
@@ -731,7 +745,7 @@ class DecodedMap {
731
745
  this._decodedMemo = memoizedState();
732
746
  this.url = from;
733
747
  this.resolvedSources = (sources || []).map(
734
- (s) => resolve(s || "", from)
748
+ (s) => resolve(from, "..", s || "")
735
749
  );
736
750
  }
737
751
  _encoded;
@@ -829,16 +843,13 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
829
843
  await ((_a = super.onBeforeTryTask) == null ? void 0 : _a.call(this, ...args));
830
844
  const trace = this.config.browser.trace;
831
845
  const test = args[0];
832
- if (trace === "off") {
833
- return;
834
- }
835
846
  const { retry, repeats } = args[1];
836
- if (trace === "on-all-retries" && retry === 0) {
837
- return;
838
- }
839
- if (trace === "on-first-retry" && retry !== 1) {
847
+ const shouldTrace = trace !== "off" && !(trace === "on-all-retries" && retry === 0) && !(trace === "on-first-retry" && retry !== 1);
848
+ if (!shouldTrace) {
849
+ getBrowserState().activeTraceTaskIds.delete(test.id);
840
850
  return;
841
851
  }
852
+ getBrowserState().activeTraceTaskIds.add(test.id);
842
853
  let title = getTestName(test);
843
854
  if (retry) {
844
855
  title += ` (retry x${retry})`;
@@ -853,16 +864,14 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
853
864
  );
854
865
  };
855
866
  onAfterRetryTask = async (test, { retry, repeats }) => {
856
- const trace = this.config.browser.trace;
857
- if (trace === "off") {
858
- return;
859
- }
860
- if (trace === "on-all-retries" && retry === 0) {
861
- return;
862
- }
863
- if (trace === "on-first-retry" && retry !== 1) {
867
+ var _a, _b, _c;
868
+ if (!getBrowserState().activeTraceTaskIds.has(test.id)) {
864
869
  return;
865
870
  }
871
+ await this.commands.triggerCommand("__vitest_markTrace", [{
872
+ name: `onAfterRetryTask [${(_a = test.result) == null ? void 0 : _a.state}]`,
873
+ stack: (_c = (_b = test.result) == null ? void 0 : _b.errors) == null ? void 0 : _c[0].stack
874
+ }]);
866
875
  const name = getTraceName(test, retry, repeats);
867
876
  if (!this.traces.has(test.id)) {
868
877
  this.traces.set(test.id, []);
@@ -903,7 +912,9 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
903
912
  };
904
913
  onTaskFinished = async (task) => {
905
914
  var _a, _b;
906
- if (this.config.browser.screenshotFailures && document.body.clientHeight > 0 && ((_a = task.result) == null ? void 0 : _a.state) === "fail") {
915
+ if (this.config.browser.screenshotFailures && document.body.clientHeight > 0 && ((_a = task.result) == null ? void 0 : _a.state) === "fail" && task.type === "test" && task.artifacts.every(
916
+ (artifact) => artifact.type !== "internal:toMatchScreenshot"
917
+ )) {
907
918
  const screenshot = await page.screenshot(
908
919
  {
909
920
  timeout: ((_b = this.config.browser.providerOptions) == null ? void 0 : _b.actionTimeout) ?? 5e3
@@ -913,7 +924,10 @@ function createBrowserRunner(runnerClass, mocker, state, coverageModule) {
913
924
  console.error("[vitest] Failed to take a screenshot", err);
914
925
  });
915
926
  if (screenshot) {
916
- task.meta.failScreenshotPath = screenshot;
927
+ await recordArtifact(task, {
928
+ type: "internal:failureScreenshot",
929
+ attachments: [{ contentType: "image/png", path: screenshot, originalPath: screenshot }]
930
+ });
917
931
  }
918
932
  }
919
933
  };
@@ -1040,7 +1054,7 @@ async function initiateRunner(state, mocker, config) {
1040
1054
  if (cachedRunner) {
1041
1055
  return cachedRunner;
1042
1056
  }
1043
- const runnerClass = config.mode === "test" ? VitestTestRunner : NodeBenchmarkRunner;
1057
+ const runnerClass = config.mode === "test" ? TestRunner : BenchmarkRunner;
1044
1058
  const BrowserRunner = createBrowserRunner(runnerClass, mocker, state, {
1045
1059
  takeCoverage: () => takeCoverageInsideWorker(config.coverage, moduleRunner)
1046
1060
  });
@@ -1377,21 +1391,25 @@ class ManualMockedModule {
1377
1391
  this.url = url2;
1378
1392
  this.factory = factory;
1379
1393
  }
1380
- async resolve() {
1394
+ resolve() {
1381
1395
  if (this.cache) {
1382
1396
  return this.cache;
1383
1397
  }
1384
1398
  let exports$1;
1385
1399
  try {
1386
- exports$1 = await this.factory();
1400
+ exports$1 = this.factory();
1387
1401
  } catch (err) {
1388
- const vitestError = new Error('[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock');
1389
- vitestError.cause = err;
1390
- throw vitestError;
1391
- }
1392
- if (exports$1 === null || typeof exports$1 !== "object" || Array.isArray(exports$1)) {
1393
- throw new TypeError(`[vitest] vi.mock("${this.raw}", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?`);
1402
+ throw createHelpfulError(err);
1403
+ }
1404
+ if (typeof exports$1 === "object" && typeof (exports$1 == null ? void 0 : exports$1.then) === "function") {
1405
+ return exports$1.then((result) => {
1406
+ assertValidExports(this.raw, result);
1407
+ return this.cache = result;
1408
+ }, (error) => {
1409
+ throw createHelpfulError(error);
1410
+ });
1394
1411
  }
1412
+ assertValidExports(this.raw, exports$1);
1395
1413
  return this.cache = exports$1;
1396
1414
  }
1397
1415
  static fromJSON(data, factory) {
@@ -1406,6 +1424,16 @@ class ManualMockedModule {
1406
1424
  };
1407
1425
  }
1408
1426
  }
1427
+ function createHelpfulError(cause) {
1428
+ const error = new Error('[vitest] There was an error when mocking a module. If you are using "vi.mock" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock');
1429
+ error.cause = cause;
1430
+ return error;
1431
+ }
1432
+ function assertValidExports(raw, exports$1) {
1433
+ if (exports$1 === null || typeof exports$1 !== "object" || Array.isArray(exports$1)) {
1434
+ throw new TypeError(`[vitest] vi.mock("${raw}", factory?: () => unknown) is not returning an object. Did you mean to return an object with a "default" key?`);
1435
+ }
1436
+ }
1409
1437
  function mockObject(options, object2, mockExports = {}) {
1410
1438
  const finalizers = new Array();
1411
1439
  const refs = new RefTracker();
@@ -1486,7 +1514,19 @@ function mockObject(options, object2, mockExports = {}) {
1486
1514
  define(newContainer, property, value);
1487
1515
  continue;
1488
1516
  }
1489
- if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
1517
+ if (options.type === "autospy" && type === "Module") {
1518
+ const exports$1 = /* @__PURE__ */ Object.create(null);
1519
+ Object.defineProperty(exports$1, Symbol.toStringTag, {
1520
+ value: "Module",
1521
+ configurable: true,
1522
+ writable: true
1523
+ });
1524
+ try {
1525
+ newContainer[property] = exports$1;
1526
+ } catch {
1527
+ continue;
1528
+ }
1529
+ } else if (!define(newContainer, property, isFunction || options.type === "autospy" ? value : {})) {
1490
1530
  continue;
1491
1531
  }
1492
1532
  if (isFunction) {
@@ -1718,6 +1758,7 @@ for (let i = 0; i < chars.length; i++) {
1718
1758
  intToChar[i] = c;
1719
1759
  charToInt[c] = i;
1720
1760
  }
1761
+ Date.now().toString().length;
1721
1762
  const { now } = Date;
1722
1763
  class ModuleMocker {
1723
1764
  registry = new MockerRegistry();
@@ -1768,7 +1809,7 @@ class ModuleMocker {
1768
1809
  throw new Error(`[vitest] Cannot resolve "${id}" imported from "${importer}"`);
1769
1810
  }
1770
1811
  const ext = extname(resolved.id);
1771
- const url2 = new URL(resolved.url, location.href);
1812
+ const url2 = new URL(resolved.url, this.getBaseUrl());
1772
1813
  const query = `_vitest_original&ext${ext}`;
1773
1814
  const actualUrl = `${url2.pathname}${url2.search ? `${url2.search}&${query}` : `?${query}`}${url2.hash}`;
1774
1815
  return this.wrapDynamicImport(() => import(
@@ -1779,12 +1820,15 @@ class ModuleMocker {
1779
1820
  return mod;
1780
1821
  }
1781
1822
  const m = mod.default;
1782
- return (m === null || m === void 0 ? void 0 : m.__esModule) ? m : {
1823
+ return (m == null ? void 0 : m.__esModule) ? m : {
1783
1824
  ...typeof m === "object" && !Array.isArray(m) || typeof m === "function" ? m : {},
1784
1825
  default: m
1785
1826
  };
1786
1827
  });
1787
1828
  }
1829
+ getBaseUrl() {
1830
+ return location.href;
1831
+ }
1788
1832
  async importMock(rawId, importer) {
1789
1833
  await this.prepare();
1790
1834
  const { resolvedId, resolvedUrl, redirectUrl } = await this.rpc.resolveMock(rawId, importer, { mock: "auto" });
@@ -1792,7 +1836,7 @@ class ModuleMocker {
1792
1836
  let mock = this.registry.get(mockUrl);
1793
1837
  if (!mock) {
1794
1838
  if (redirectUrl) {
1795
- const resolvedRedirect = new URL(this.resolveMockPath(cleanVersion(redirectUrl)), location.href).toString();
1839
+ const resolvedRedirect = new URL(this.resolveMockPath(cleanVersion(redirectUrl)), this.getBaseUrl()).toString();
1796
1840
  mock = new RedirectedModule(rawId, resolvedId, mockUrl, resolvedRedirect);
1797
1841
  } else {
1798
1842
  mock = new AutomockedModule(rawId, resolvedId, mockUrl);
@@ -1802,7 +1846,7 @@ class ModuleMocker {
1802
1846
  return await mock.resolve();
1803
1847
  }
1804
1848
  if (mock.type === "automock" || mock.type === "autospy") {
1805
- const url2 = new URL(`/@id/${resolvedId}`, location.href);
1849
+ const url2 = new URL(`/@id/${resolvedId}`, this.getBaseUrl());
1806
1850
  const query = url2.search ? `${url2.search}&t=${now()}` : `?t=${now()}`;
1807
1851
  const moduleObject = await __vitePreload(() => import(
1808
1852
  /* @vite-ignore */
@@ -1815,8 +1859,16 @@ class ModuleMocker {
1815
1859
  mock.redirect
1816
1860
  );
1817
1861
  }
1818
- mockObject(object2, moduleType = "automock") {
1819
- return mockObject({
1862
+ mockObject(object2, mockExportsOrModuleType, moduleType) {
1863
+ let mockExports;
1864
+ if (mockExportsOrModuleType === "automock" || mockExportsOrModuleType === "autospy") {
1865
+ moduleType = mockExportsOrModuleType;
1866
+ mockExports = void 0;
1867
+ } else {
1868
+ mockExports = mockExportsOrModuleType;
1869
+ }
1870
+ moduleType ?? (moduleType = "automock");
1871
+ const result = mockObject({
1820
1872
  globalConstructors: {
1821
1873
  Object,
1822
1874
  Function,
@@ -1826,17 +1878,21 @@ class ModuleMocker {
1826
1878
  },
1827
1879
  createMockInstance: this.createMockInstance,
1828
1880
  type: moduleType
1829
- }, object2);
1881
+ }, object2, mockExports);
1882
+ return result;
1883
+ }
1884
+ getMockContext() {
1885
+ return { callstack: null };
1830
1886
  }
1831
1887
  queueMock(rawId, importer, factoryOrOptions) {
1832
- const promise = this.rpc.resolveMock(rawId, importer, { mock: typeof factoryOrOptions === "function" ? "factory" : (factoryOrOptions === null || factoryOrOptions === void 0 ? void 0 : factoryOrOptions.spy) ? "spy" : "auto" }).then(async ({ redirectUrl, resolvedId, resolvedUrl, needsInterop, mockType }) => {
1888
+ const promise = this.rpc.resolveMock(rawId, importer, { mock: typeof factoryOrOptions === "function" ? "factory" : (factoryOrOptions == null ? void 0 : factoryOrOptions.spy) ? "spy" : "auto" }).then(async ({ redirectUrl, resolvedId, resolvedUrl, needsInterop, mockType }) => {
1833
1889
  const mockUrl = this.resolveMockPath(cleanVersion(resolvedUrl));
1834
1890
  this.mockedIds.add(resolvedId);
1835
1891
  const factory = typeof factoryOrOptions === "function" ? async () => {
1836
1892
  const data = await factoryOrOptions();
1837
1893
  return needsInterop ? { default: data } : data;
1838
1894
  } : void 0;
1839
- const mockRedirect = typeof redirectUrl === "string" ? new URL(this.resolveMockPath(cleanVersion(redirectUrl)), location.href).toString() : null;
1895
+ const mockRedirect = typeof redirectUrl === "string" ? new URL(this.resolveMockPath(cleanVersion(redirectUrl)), this.getBaseUrl()).toString() : null;
1840
1896
  let module;
1841
1897
  if (mockType === "manual") {
1842
1898
  module = this.registry.register("manual", rawId, resolvedId, mockUrl, factory);
@@ -1880,6 +1936,14 @@ class ModuleMocker {
1880
1936
  }
1881
1937
  return moduleFactory;
1882
1938
  }
1939
+ getMockedModuleById(id) {
1940
+ return this.registry.getById(id);
1941
+ }
1942
+ reset() {
1943
+ this.registry.clear();
1944
+ this.mockedIds.clear();
1945
+ this.queue.clear();
1946
+ }
1883
1947
  resolveMockPath(path) {
1884
1948
  const config = this.config;
1885
1949
  const fsRoot = join("/@fs/", config.root);
@@ -1924,7 +1988,22 @@ function createModuleMockerInterceptor() {
1924
1988
  function rpc() {
1925
1989
  return getWorkerState().rpc;
1926
1990
  }
1927
- getBrowserState().provider;
1991
+ const ACTION_TRACE_COMMANDS = /* @__PURE__ */ new Set([
1992
+ "__vitest_click",
1993
+ "__vitest_dblClick",
1994
+ "__vitest_tripleClick",
1995
+ "__vitest_wheel",
1996
+ "__vitest_type",
1997
+ "__vitest_clear",
1998
+ "__vitest_fill",
1999
+ "__vitest_selectOptions",
2000
+ "__vitest_dragAndDrop",
2001
+ "__vitest_hover",
2002
+ "__vitest_upload",
2003
+ "__vitest_tab",
2004
+ "__vitest_keyboard",
2005
+ "__vitest_takeScreenshot"
2006
+ ]);
1928
2007
  class CommandsManager {
1929
2008
  _listeners = [];
1930
2009
  onCommand(listener) {
@@ -1937,6 +2016,9 @@ class CommandsManager {
1937
2016
  const { sessionId, traces: traces2 } = getBrowserState();
1938
2017
  const filepath = state.filepath || ((_b = (_a = state.current) == null ? void 0 : _a.file) == null ? void 0 : _b.filepath);
1939
2018
  args = args.filter((arg) => arg !== void 0);
2019
+ const actionTraceGroupName = ACTION_TRACE_COMMANDS.has(command) ? command : void 0;
2020
+ const currentTest = getWorkerState().current;
2021
+ const shouldMarkTrace = actionTraceGroupName && !!currentTest && getBrowserState().activeTraceTaskIds.has(currentTest.id);
1940
2022
  if (this._listeners.length) {
1941
2023
  await Promise.all(this._listeners.map((listener) => listener(command, args)));
1942
2024
  }
@@ -1948,16 +2030,42 @@ class CommandsManager {
1948
2030
  "code.file.path": filepath
1949
2031
  }
1950
2032
  },
1951
- () => rpc2.triggerCommand(sessionId, command, filepath, args).catch((err) => {
2033
+ async () => {
1952
2034
  var _a2;
1953
- clientError.message = err.message;
1954
- clientError.name = err.name;
1955
- clientError.stack = (_a2 = clientError.stack) == null ? void 0 : _a2.replace(clientError.message, err.message);
1956
- throw clientError;
1957
- })
2035
+ if (shouldMarkTrace) {
2036
+ await rpc2.triggerCommand(
2037
+ sessionId,
2038
+ "__vitest_groupTraceStart",
2039
+ filepath,
2040
+ [{
2041
+ name: actionTraceGroupName,
2042
+ stack: clientError.stack
2043
+ }]
2044
+ );
2045
+ }
2046
+ try {
2047
+ return await rpc2.triggerCommand(sessionId, command, filepath, args);
2048
+ } catch (err) {
2049
+ clientError.message = err.message;
2050
+ clientError.name = err.name;
2051
+ clientError.stack = (_a2 = clientError.stack) == null ? void 0 : _a2.replace(clientError.message, err.message);
2052
+ throw clientError;
2053
+ } finally {
2054
+ if (shouldMarkTrace) {
2055
+ await rpc2.triggerCommand(
2056
+ sessionId,
2057
+ "__vitest_groupTraceEnd",
2058
+ filepath,
2059
+ []
2060
+ );
2061
+ }
2062
+ }
2063
+ }
1958
2064
  );
1959
2065
  }
1960
2066
  }
2067
+ globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
2068
+ getBrowserState().provider;
1961
2069
  const debugVar = getConfig().env.VITEST_BROWSER_DEBUG;
1962
2070
  const debug = debugVar && debugVar !== "false" ? (...args) => {
1963
2071
  var _a, _b;
@@ -2033,6 +2141,7 @@ const url = new URL(location.href);
2033
2141
  const iframeId = url.searchParams.get("iframeId");
2034
2142
  const commands = new CommandsManager();
2035
2143
  getBrowserState().commands = commands;
2144
+ getBrowserState().activeTraceTaskIds = /* @__PURE__ */ new Set();
2036
2145
  getBrowserState().iframeId = iframeId;
2037
2146
  let contextSwitched = false;
2038
2147
  async function prepareTestEnvironment(options) {
@@ -159,9 +159,9 @@ function generateFileHash(file, projectName) {
159
159
  function getNames(task) {
160
160
  const names = [task.name];
161
161
  let current = task;
162
- while (current === null || current === void 0 ? void 0 : current.suite) {
162
+ while (current == null ? void 0 : current.suite) {
163
163
  current = current.suite;
164
- if (current === null || current === void 0 ? void 0 : current.name) {
164
+ if (current == null ? void 0 : current.name) {
165
165
  names.unshift(current.name);
166
166
  }
167
167
  }
@@ -1,5 +1,50 @@
1
- <svg width="165" height="165" viewBox="0 0 165 165" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M120.831 57.2543L84.693 109.505C84.3099 110.059 83.7558 110.474 83.1148 110.687C82.4738 110.9 81.7809 110.898 81.1412 110.684C80.5015 110.469 79.95 110.052 79.5702 109.497C79.1905 108.941 79.0032 108.277 79.037 107.606L80.4833 78.7582L57.1343 73.8064C56.6353 73.7007 56.1704 73.474 55.7807 73.1465C55.391 72.8191 55.0885 72.4009 54.9001 71.929C54.7117 71.4571 54.6432 70.9461 54.7006 70.4412C54.758 69.9364 54.9395 69.4532 55.2291 69.0345L91.3675 16.7837C91.7507 16.2294 92.3048 15.8145 92.9458 15.6018C93.5869 15.3891 94.2798 15.3902 94.9196 15.6051C95.5593 15.8199 96.1109 16.2367 96.4906 16.7923C96.8703 17.3478 97.0575 18.0117 97.0236 18.6833L95.5773 47.5314L118.926 52.4828C119.425 52.5885 119.89 52.8152 120.28 53.1426C120.67 53.4701 120.972 53.8883 121.16 54.3602C121.349 54.8321 121.417 55.3431 121.36 55.8479C121.303 56.3528 121.121 56.836 120.831 57.2547L120.831 57.2543Z" fill="#FCC72B"/>
3
- <path d="M82.9866 153.343C82.0254 153.344 81.0735 153.156 80.1855 152.788C79.2975 152.42 78.4909 151.88 77.8122 151.2L43.6658 117.056C42.2998 115.683 41.5341 113.824 41.5366 111.887C41.5392 109.95 42.3098 108.092 43.6796 106.723C45.0493 105.353 46.9064 104.582 48.8435 104.579C50.7807 104.577 52.6399 105.342 54.0134 106.708L82.9866 135.678L146.105 72.5626C147.481 71.2088 149.336 70.4536 151.266 70.4615C153.197 70.4693 155.046 71.2396 156.41 72.6045C157.775 73.9695 158.546 75.8184 158.554 77.7487C158.561 79.679 157.806 81.5342 156.452 82.9101L88.1597 151.2C87.4811 151.881 86.6747 152.42 85.7869 152.788C84.8992 153.156 83.9475 153.344 82.9866 153.343Z" fill="#729B1B"/>
4
- <path d="M82.9572 153.343C83.9184 153.344 84.8703 153.156 85.7583 152.788C86.6463 152.42 87.4528 151.88 88.1316 151.2L122.278 117.056C123.644 115.683 124.41 113.824 124.407 111.887C124.405 109.95 123.634 108.092 122.264 106.723C120.894 105.353 119.037 104.582 117.1 104.579C115.163 104.577 113.304 105.342 111.93 106.708L82.9572 135.678L19.8389 72.5626C18.4629 71.2088 16.6077 70.4536 14.6775 70.4615C12.7472 70.4693 10.8982 71.2396 9.53331 72.6045C8.16839 73.9695 7.39811 75.8184 7.39025 77.7487C7.38239 79.679 8.13759 81.5342 9.49135 82.9101L77.784 151.2C78.4627 151.881 79.2691 152.42 80.1568 152.788C81.0446 153.156 81.9963 153.344 82.9572 153.343Z" fill="#729B1B" fill-opacity="0.5"/>
1
+ <svg width="45" height="43" viewBox="0 0 45 43" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M21.2659 42.2067C20.9342 42.797 20.163 42.965 19.6137 42.5665L0.465308 28.6398C0.172341 28.4265 0 28.0862 0 27.7243V10.939C0 10.0148 1.04907 9.48061 1.79657 10.0235L13.5088 18.541C14.6031 19.3381 16.1476 18.9999 16.8111 17.8215L26.5113 0.577439C26.7117 0.222001 27.0887 0.00012207 27.498 0.00012207H43.0726C43.9385 0.00012207 44.4836 0.932876 44.0592 1.68683L21.2659 42.2046V42.2067Z" fill="#22FF84"/>
3
+ <mask id="mask0_2002_17204" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="45" height="43">
4
+ <path d="M21.2659 42.2066C20.9342 42.7968 20.163 42.9649 19.6137 42.5663L0.465308 28.6397C0.172341 28.4264 0 28.086 0 27.7241V10.9389C0 10.0147 1.04907 9.48049 1.79657 10.0233L13.5088 18.5409C14.6031 19.338 16.1476 18.9998 16.8111 17.8214L26.5113 0.577317C26.7117 0.221879 27.0887 0 27.498 0H43.0726C43.9385 0 44.4836 0.932754 44.0592 1.68671L21.2659 42.2044V42.2066Z" fill="black"/>
5
+ </mask>
6
+ <g mask="url(#mask0_2002_17204)">
7
+ <g filter="url(#filter0_f_2002_17204)">
8
+ <ellipse cx="14.0313" cy="3.39062" rx="14.0313" ry="3.39062" transform="matrix(-0.650066 0.759878 0.759879 0.650065 32.5093 -3.61884)" fill="#00CCC6"/>
9
+ </g>
10
+ <g filter="url(#filter1_f_2002_17204)">
11
+ <ellipse cx="14.0313" cy="6.0868" rx="14.0313" ry="6.0868" transform="matrix(-0.588245 -0.808682 -0.808682 0.588246 16.1094 37.5068)" fill="#00CCC6"/>
12
+ </g>
13
+ <g filter="url(#filter2_f_2002_17204)">
14
+ <ellipse cx="6.44313" cy="12.1953" rx="6.37416" ry="5.55082" transform="rotate(23.1293 6.44313 12.1953)" fill="#77FF00"/>
15
+ </g>
16
+ <g filter="url(#filter3_f_2002_17204)">
17
+ <ellipse cx="40.7746" cy="15.9509" rx="5.61461" ry="24.5343" transform="rotate(23.1293 40.7746 15.9509)" fill="#77FF00"/>
18
+ </g>
19
+ <g filter="url(#filter4_f_2002_17204)">
20
+ <ellipse cx="4.98534" cy="10.0691" rx="4.98534" ry="10.0691" transform="matrix(0.707107 -0.707107 -0.707107 -0.707107 39.4482 10.9414)" fill="#97FFE2"/>
21
+ </g>
22
+ </g>
23
+ <defs>
24
+ <filter id="filter0_f_2002_17204" x="7.29277" y="-10.8334" width="37.3432" height="40.1616" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
25
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
26
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
27
+ <feGaussianBlur stdDeviation="4.59556" result="effect1_foregroundBlur_2002_17204"/>
28
+ </filter>
29
+ <filter id="filter1_f_2002_17204" x="-15.8693" y="8.64781" width="37.6054" height="42.1854" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
30
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
31
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
32
+ <feGaussianBlur stdDeviation="4.59556" result="effect1_foregroundBlur_2002_17204"/>
33
+ </filter>
34
+ <filter id="filter2_f_2002_17204" x="-9.0041" y="-2.68275" width="30.8944" height="29.7561" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
35
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
36
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
37
+ <feGaussianBlur stdDeviation="4.59556" result="effect1_foregroundBlur_2002_17204"/>
38
+ </filter>
39
+ <filter id="filter3_f_2002_17204" x="20.6482" y="-15.9117" width="40.2528" height="63.7251" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
40
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
41
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
42
+ <feGaussianBlur stdDeviation="4.59556" result="effect1_foregroundBlur_2002_17204"/>
43
+ </filter>
44
+ <filter id="filter4_f_2002_17204" x="18.7156" y="-16.8414" width="34.2758" height="34.2754" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
45
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
46
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
47
+ <feGaussianBlur stdDeviation="4.59556" result="effect1_foregroundBlur_2002_17204"/>
48
+ </filter>
49
+ </defs>
5
50
  </svg>
@@ -26,8 +26,8 @@
26
26
  {__VITEST_INJECTOR__}
27
27
  {__VITEST_ERROR_CATCHER__}
28
28
  {__VITEST_SCRIPTS__}
29
- <script type="module" crossorigin src="/__vitest_browser__/orchestrator-S_3e_uzt.js"></script>
30
- <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-uxqdqUz8.js">
29
+ <script type="module" crossorigin src="/__vitest_browser__/orchestrator-CXs6qrFe.js"></script>
30
+ <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-C2ISqq1C.js">
31
31
  </head>
32
32
  <body>
33
33
  <div id="vitest-tester"></div>
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" href="{__VITEST_FAVICON__}" type="image/svg+xml">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vitest Browser Tester</title>
8
- <script type="module" crossorigin src="/__vitest_browser__/tester-k74mgIRa.js"></script>
9
- <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-uxqdqUz8.js">
8
+ <script type="module" crossorigin src="/__vitest_browser__/tester-K5NNxh1O.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/__vitest_browser__/utils-C2ISqq1C.js">
10
10
  </head>
11
11
  <body>
12
12
  </body>
@@ -226,8 +226,7 @@ const Primitives = (_, value) => (
226
226
  typeof value === primitive ? new Primitive(value) : value
227
227
  );
228
228
 
229
- const revive = (input, parsed, output, $) => {
230
- const lazy = [];
229
+ const resolver = (input, lazy, parsed, $) => output => {
231
230
  for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
232
231
  const k = ke[y];
233
232
  const value = output[k];
@@ -236,7 +235,7 @@ const revive = (input, parsed, output, $) => {
236
235
  if (typeof tmp === object && !parsed.has(tmp)) {
237
236
  parsed.add(tmp);
238
237
  output[k] = ignore;
239
- lazy.push({k, a: [input, parsed, tmp, $]});
238
+ lazy.push({ o: output, k, r: tmp });
240
239
  }
241
240
  else
242
241
  output[k] = $.call(output, k, tmp);
@@ -244,10 +243,6 @@ const revive = (input, parsed, output, $) => {
244
243
  else if (output[k] !== ignore)
245
244
  output[k] = $.call(output, k, value);
246
245
  }
247
- for (let {length} = lazy, i = 0; i < length; i++) {
248
- const {k, a} = lazy[i];
249
- output[k] = $.call(output, k, revive.apply(null, a));
250
- }
251
246
  return output;
252
247
  };
253
248
 
@@ -265,12 +260,24 @@ const set = (known, input, value) => {
265
260
  */
266
261
  const parse = (text, reviver) => {
267
262
  const input = $parse(text, Primitives).map(primitives);
268
- const value = input[0];
269
263
  const $ = reviver || noop;
270
- const tmp = typeof value === object && value ?
271
- revive(input, new Set, value, $) :
272
- value;
273
- return $.call({'': tmp}, '', tmp);
264
+
265
+ let value = input[0];
266
+
267
+ if (typeof value === object && value) {
268
+ const lazy = [];
269
+ const revive = resolver(input, lazy, new Set, $);
270
+ value = revive(value);
271
+
272
+ let i = 0;
273
+ while (i < lazy.length) {
274
+ // it could be a lazy.shift() but that's costly
275
+ const {o, k, r} = lazy[i++];
276
+ o[k] = $.call(o, k, revive(r));
277
+ }
278
+ }
279
+
280
+ return $.call({'': value}, '', value);
274
281
  };
275
282
 
276
283
  /**
@@ -324,7 +331,7 @@ const PORT = location.port;
324
331
  const HOST = [location.hostname, PORT].filter(Boolean).join(":");
325
332
  const RPC_ID = PAGE_TYPE === "orchestrator" ? getBrowserState().sessionId : getBrowserState().testerId;
326
333
  const METHOD = getBrowserState().method;
327
- const ENTRY_URL = `${location.protocol === "https:" ? "wss:" : "ws:"}//${HOST}/__vitest_browser_api__?type=${PAGE_TYPE}&rpcId=${RPC_ID}&sessionId=${getBrowserState().sessionId}&projectName=${getBrowserState().config.name || ""}&method=${METHOD}&token=${window.VITEST_API_TOKEN || "0"}`;
334
+ const ENTRY_URL = `${location.protocol === "https:" ? "wss:" : "ws:"}//${HOST}/__vitest_browser_api__?type=${PAGE_TYPE}&rpcId=${RPC_ID}&sessionId=${getBrowserState().sessionId}&projectName=${encodeURIComponent(getBrowserState().config.name || "")}&method=${METHOD}&token=${window.VITEST_API_TOKEN || "0"}`;
328
335
  const onCancelCallbacks = [];
329
336
  function onCancel(callback) {
330
337
  onCancelCallbacks.push(callback);