@vitest/browser 4.1.1 → 4.1.3

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.
@@ -27,7 +27,7 @@
27
27
  fetch(link.href, fetchOpts);
28
28
  }
29
29
  })();
30
- var d = {
30
+ var b = {
31
31
  reset: [0, 0],
32
32
  bold: [1, 22, "\x1B[22m\x1B[1m"],
33
33
  dim: [2, 22, "\x1B[22m\x1B[2m"],
@@ -70,42 +70,43 @@ var d = {
70
70
  bgCyanBright: [106, 49],
71
71
  bgWhiteBright: [107, 49]
72
72
  };
73
- function g(e) {
73
+ function i(e) {
74
74
  return String(e);
75
75
  }
76
- g.open = "";
77
- g.close = "";
78
- function h() {
79
- let e = typeof process != "undefined" ? process : void 0, n = (e == null ? void 0 : e.env) || {}, a = n.FORCE_TTY !== "false", i = (e == null ? void 0 : e.argv) || [];
80
- return !("NO_COLOR" in n || i.includes("--no-color")) && ("FORCE_COLOR" in n || i.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || a && n.TERM !== "dumb" || "CI" in n) || typeof window != "undefined" && !!window.chrome;
76
+ i.open = "";
77
+ i.close = "";
78
+ function B() {
79
+ let e = typeof process != "undefined" ? process : void 0, r = (e == null ? void 0 : e.env) || {}, a = r.FORCE_TTY !== "false", l = (e == null ? void 0 : e.argv) || [];
80
+ return !("NO_COLOR" in r || l.includes("--no-color")) && ("FORCE_COLOR" in r || l.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || a && r.TERM !== "dumb" || "CI" in r) || typeof window != "undefined" && !!window.chrome;
81
81
  }
82
- function f() {
83
- let e = h(), n = (r, t, u, o) => {
84
- let l = "", s = 0;
82
+ function C({ force: e } = {}) {
83
+ let r = e || B(), a = (t, o, u, n) => {
84
+ let g = "", s = 0;
85
85
  do
86
- l += r.substring(s, o) + u, s = o + t.length, o = r.indexOf(t, s);
87
- while (~o);
88
- return l + r.substring(s);
89
- }, a = (r, t, u = r) => {
90
- let o = (l) => {
91
- let s = String(l), b = s.indexOf(t, r.length);
92
- return ~b ? r + n(s, t, u, b) + t : r + s + t;
86
+ g += t.substring(s, n) + u, s = n + o.length, n = t.indexOf(o, s);
87
+ while (~n);
88
+ return g + t.substring(s);
89
+ }, l = (t, o, u = t) => {
90
+ let n = (g) => {
91
+ let s = String(g), h = s.indexOf(o, t.length);
92
+ return ~h ? t + a(s, o, u, h) + o : t + s + o;
93
93
  };
94
- return o.open = r, o.close = t, o;
95
- }, i = {
96
- isColorSupported: e
97
- }, c = (r) => `\x1B[${r}m`;
98
- for (let r in d) {
99
- let t = d[r];
100
- i[r] = e ? a(
101
- c(t[0]),
102
- c(t[1]),
103
- t[2]
104
- ) : g;
105
- }
106
- return i;
107
- }
108
- var C = f();
94
+ return n.open = t, n.close = o, n;
95
+ }, c = {
96
+ isColorSupported: r
97
+ }, f = (t) => `\x1B[${t}m`;
98
+ for (let t in b) {
99
+ let o = b[t];
100
+ c[t] = r ? l(
101
+ f(o[0]),
102
+ f(o[1]),
103
+ o[2]
104
+ ) : i;
105
+ }
106
+ return c;
107
+ }
108
+ var d = C();
109
+ var y = d;
109
110
  function _mergeNamespaces$1(n, m) {
110
111
  m.forEach(function(e) {
111
112
  e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
@@ -194,16 +195,16 @@ function printListItems(list, config, indentation, depth, refs, printer2) {
194
195
  if (length > 0) {
195
196
  result += config.spacingOuter;
196
197
  const indentationNext = indentation + config.indent;
197
- for (let i = 0; i < length; i++) {
198
+ for (let i2 = 0; i2 < length; i2++) {
198
199
  result += indentationNext;
199
- if (i === config.maxWidth) {
200
+ if (i2 === config.maxWidth) {
200
201
  result += "…";
201
202
  break;
202
203
  }
203
- if (isDataView(list) || i in list) {
204
- result += printer2(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs);
204
+ if (isDataView(list) || i2 in list) {
205
+ result += printer2(isDataView(list) ? list.getInt8(i2) : list[i2], config, indentationNext, depth, refs);
205
206
  }
206
- if (i < length - 1) {
207
+ if (i2 < length - 1) {
207
208
  result += `,${config.spacingInner}`;
208
209
  } else if (!config.min) {
209
210
  result += ",";
@@ -219,12 +220,12 @@ function printObjectProperties(val, config, indentation, depth, refs, printer2)
219
220
  if (keys.length > 0) {
220
221
  result += config.spacingOuter;
221
222
  const indentationNext = indentation + config.indent;
222
- for (let i = 0; i < keys.length; i++) {
223
- const key = keys[i];
223
+ for (let i2 = 0; i2 < keys.length; i2++) {
224
+ const key = keys[i2];
224
225
  const name = printer2(key, config, indentationNext, depth, refs);
225
226
  const value = printer2(val[key], config, indentationNext, depth, refs);
226
227
  result += `${indentationNext + name}: ${value}`;
227
- if (i < keys.length - 1) {
228
+ if (i2 < keys.length - 1) {
228
229
  result += `,${config.spacingInner}`;
229
230
  } else if (!config.min) {
230
231
  result += ",";
@@ -428,10 +429,10 @@ function printImmutableEntries(val, config, indentation, depth, refs, printer2,
428
429
  return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer2)}}`;
429
430
  }
430
431
  function getRecordEntries(val) {
431
- let i = 0;
432
+ let i2 = 0;
432
433
  return { next() {
433
- if (i < val._keys.length) {
434
- const key = val._keys[i++];
434
+ if (i2 < val._keys.length) {
435
+ const key = val._keys[i2++];
435
436
  return {
436
437
  done: false,
437
438
  value: [key, val.get(key)]
@@ -617,16 +618,16 @@ var hasRequiredReactIs_production_min;
617
618
  function requireReactIs_production_min() {
618
619
  if (hasRequiredReactIs_production_min) return reactIs_production_min;
619
620
  hasRequiredReactIs_production_min = 1;
620
- var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d2 = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f2 = Symbol.for("react.profiler"), g2 = Symbol.for("react.provider"), h2 = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
621
+ var b2 = Symbol.for("react.element"), c = Symbol.for("react.portal"), d2 = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
621
622
  u = Symbol.for("react.module.reference");
622
623
  function v(a) {
623
624
  if ("object" === typeof a && null !== a) {
624
625
  var r = a.$$typeof;
625
626
  switch (r) {
626
- case b:
627
+ case b2:
627
628
  switch (a = a.type, a) {
628
629
  case d2:
629
- case f2:
630
+ case f:
630
631
  case e:
631
632
  case m:
632
633
  case n:
@@ -634,11 +635,11 @@ function requireReactIs_production_min() {
634
635
  default:
635
636
  switch (a = a && a.$$typeof, a) {
636
637
  case k:
637
- case h2:
638
+ case h:
638
639
  case l:
639
640
  case q:
640
641
  case p:
641
- case g2:
642
+ case g:
642
643
  return a;
643
644
  default:
644
645
  return r;
@@ -649,15 +650,15 @@ function requireReactIs_production_min() {
649
650
  }
650
651
  }
651
652
  }
652
- reactIs_production_min.ContextConsumer = h2;
653
- reactIs_production_min.ContextProvider = g2;
654
- reactIs_production_min.Element = b;
653
+ reactIs_production_min.ContextConsumer = h;
654
+ reactIs_production_min.ContextProvider = g;
655
+ reactIs_production_min.Element = b2;
655
656
  reactIs_production_min.ForwardRef = l;
656
657
  reactIs_production_min.Fragment = d2;
657
658
  reactIs_production_min.Lazy = q;
658
659
  reactIs_production_min.Memo = p;
659
660
  reactIs_production_min.Portal = c;
660
- reactIs_production_min.Profiler = f2;
661
+ reactIs_production_min.Profiler = f;
661
662
  reactIs_production_min.StrictMode = e;
662
663
  reactIs_production_min.Suspense = m;
663
664
  reactIs_production_min.SuspenseList = n;
@@ -668,13 +669,13 @@ function requireReactIs_production_min() {
668
669
  return false;
669
670
  };
670
671
  reactIs_production_min.isContextConsumer = function(a) {
671
- return v(a) === h2;
672
+ return v(a) === h;
672
673
  };
673
674
  reactIs_production_min.isContextProvider = function(a) {
674
- return v(a) === g2;
675
+ return v(a) === g;
675
676
  };
676
677
  reactIs_production_min.isElement = function(a) {
677
- return "object" === typeof a && null !== a && a.$$typeof === b;
678
+ return "object" === typeof a && null !== a && a.$$typeof === b2;
678
679
  };
679
680
  reactIs_production_min.isForwardRef = function(a) {
680
681
  return v(a) === l;
@@ -692,7 +693,7 @@ function requireReactIs_production_min() {
692
693
  return v(a) === c;
693
694
  };
694
695
  reactIs_production_min.isProfiler = function(a) {
695
- return v(a) === f2;
696
+ return v(a) === f;
696
697
  };
697
698
  reactIs_production_min.isStrictMode = function(a) {
698
699
  return v(a) === e;
@@ -704,7 +705,7 @@ function requireReactIs_production_min() {
704
705
  return v(a) === n;
705
706
  };
706
707
  reactIs_production_min.isValidElementType = function(a) {
707
- return "string" === typeof a || "function" === typeof a || a === d2 || a === f2 || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g2 || a.$$typeof === h2 || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
708
+ return "string" === typeof a || "function" === typeof a || a === d2 || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
708
709
  };
709
710
  reactIs_production_min.typeOf = v;
710
711
  return reactIs_production_min;
@@ -969,6 +970,7 @@ function findPlugin(plugins2, val) {
969
970
  return null;
970
971
  }
971
972
  function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
973
+ var _a;
972
974
  let result;
973
975
  const plugin2 = findPlugin(config.plugins, val);
974
976
  if (plugin2 !== null) {
@@ -981,8 +983,9 @@ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
981
983
  result = printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
982
984
  }
983
985
  }
984
- config.outputLength += result.length;
985
- if (config.outputLength > config.maxOutputLength) {
986
+ (_a = config._outputLengthPerDepth)[depth] ?? (_a[depth] = 0);
987
+ config._outputLengthPerDepth[depth] += result.length;
988
+ if (config._outputLengthPerDepth[depth] > config.maxOutputLength) {
986
989
  config.maxDepth = 0;
987
990
  }
988
991
  return result;
@@ -1025,7 +1028,7 @@ function validateOptions(options) {
1025
1028
  function getColorsHighlight() {
1026
1029
  return DEFAULT_THEME_KEYS.reduce((colors, key) => {
1027
1030
  const value = DEFAULT_THEME[key];
1028
- const color = value && C[value];
1031
+ const color = value && y[value];
1029
1032
  if (color && typeof color.close === "string" && typeof color.open === "string") {
1030
1033
  colors[key] = color;
1031
1034
  } else {
@@ -1070,7 +1073,7 @@ function getConfig$1(options) {
1070
1073
  spacingInner: (options == null ? void 0 : options.min) ? " " : "\n",
1071
1074
  spacingOuter: (options == null ? void 0 : options.min) ? "" : "\n",
1072
1075
  maxOutputLength: (options == null ? void 0 : options.maxOutputLength) ?? DEFAULT_OPTIONS.maxOutputLength,
1073
- outputLength: 0
1076
+ _outputLengthPerDepth: []
1074
1077
  };
1075
1078
  }
1076
1079
  function createIndent(indent) {
@@ -1208,11 +1211,11 @@ function inspectList(list, options, inspectItem, separator = ", ") {
1208
1211
  let output = "";
1209
1212
  let peek = "";
1210
1213
  let truncated = "";
1211
- for (let i = 0; i < size; i += 1) {
1212
- const last = i + 1 === list.length;
1213
- const secondToLast = i + 2 === list.length;
1214
- truncated = `${truncator}(${list.length - i})`;
1215
- const value = list[i];
1214
+ for (let i2 = 0; i2 < size; i2 += 1) {
1215
+ const last = i2 + 1 === list.length;
1216
+ const secondToLast = i2 + 2 === list.length;
1217
+ truncated = `${truncator}(${list.length - i2})`;
1218
+ const value = list[i2];
1216
1219
  options.truncate = originalLength - output.length - (last ? 0 : separator.length);
1217
1220
  const string = peek || inspectItem(value, options) + (last ? "" : separator);
1218
1221
  const nextLength = output.length + string.length;
@@ -1223,13 +1226,13 @@ function inspectList(list, options, inspectItem, separator = ", ") {
1223
1226
  if (!last && !secondToLast && truncatedLength > originalLength) {
1224
1227
  break;
1225
1228
  }
1226
- peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
1229
+ peek = last ? "" : inspectItem(list[i2 + 1], options) + (secondToLast ? "" : separator);
1227
1230
  if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) {
1228
1231
  break;
1229
1232
  }
1230
1233
  output += string;
1231
1234
  if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
1232
- truncated = `${truncator}(${list.length - i - 1})`;
1235
+ truncated = `${truncator}(${list.length - i2 - 1})`;
1233
1236
  break;
1234
1237
  }
1235
1238
  truncated = "";
@@ -1282,11 +1285,11 @@ function inspectTypedArray(array, options) {
1282
1285
  if (!array.length && !nonIndexProperties.length)
1283
1286
  return `${name}[]`;
1284
1287
  let output = "";
1285
- for (let i = 0; i < array.length; i++) {
1286
- const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
1288
+ for (let i2 = 0; i2 < array.length; i2++) {
1289
+ const string = `${options.stylize(truncate(array[i2], options.truncate), "number")}${i2 === array.length - 1 ? "" : ", "}`;
1287
1290
  options.truncate -= string.length;
1288
- if (array[i] !== array.length && options.truncate <= 3) {
1289
- output += `${truncator}(${array.length - array[i] + 1})`;
1291
+ if (array[i2] !== array.length && options.truncate <= 3) {
1292
+ output += `${truncator}(${array.length - array[i2] + 1})`;
1290
1293
  break;
1291
1294
  }
1292
1295
  output += string;
@@ -1334,7 +1337,7 @@ function inspectMap(map, options) {
1334
1337
  options.truncate -= 7;
1335
1338
  return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
1336
1339
  }
1337
- const isNaN = Number.isNaN || ((i) => i !== i);
1340
+ const isNaN = Number.isNaN || ((i2) => i2 !== i2);
1338
1341
  function inspectNumber(number, options) {
1339
1342
  if (isNaN(number)) {
1340
1343
  return options.stylize("NaN", "number");
@@ -1690,8 +1693,8 @@ function baseFormat(args, options = {}) {
1690
1693
  };
1691
1694
  if (typeof args[0] !== "string") {
1692
1695
  const objects = [];
1693
- for (let i2 = 0; i2 < args.length; i2++) {
1694
- objects.push(formatArg(args[i2], {
1696
+ for (let i3 = 0; i3 < args.length; i3++) {
1697
+ objects.push(formatArg(args[i3], {
1695
1698
  depth: 0,
1696
1699
  colors: false
1697
1700
  }));
@@ -1699,18 +1702,18 @@ function baseFormat(args, options = {}) {
1699
1702
  return objects.join(" ");
1700
1703
  }
1701
1704
  const len = args.length;
1702
- let i = 1;
1705
+ let i2 = 1;
1703
1706
  const template = args[0];
1704
1707
  let str = String(template).replace(formatRegExp, (x) => {
1705
1708
  if (x === "%%") {
1706
1709
  return "%";
1707
1710
  }
1708
- if (i >= len) {
1711
+ if (i2 >= len) {
1709
1712
  return x;
1710
1713
  }
1711
1714
  switch (x) {
1712
1715
  case "%s": {
1713
- const value = args[i++];
1716
+ const value = args[i2++];
1714
1717
  if (typeof value === "bigint") {
1715
1718
  return `${value.toString()}n`;
1716
1719
  }
@@ -1729,7 +1732,7 @@ function baseFormat(args, options = {}) {
1729
1732
  return String(value);
1730
1733
  }
1731
1734
  case "%d": {
1732
- const value = args[i++];
1735
+ const value = args[i2++];
1733
1736
  if (typeof value === "bigint") {
1734
1737
  return `${value.toString()}n`;
1735
1738
  }
@@ -1739,28 +1742,28 @@ function baseFormat(args, options = {}) {
1739
1742
  return Number(value).toString();
1740
1743
  }
1741
1744
  case "%i": {
1742
- const value = args[i++];
1745
+ const value = args[i2++];
1743
1746
  if (typeof value === "bigint") {
1744
1747
  return `${value.toString()}n`;
1745
1748
  }
1746
1749
  return Number.parseInt(String(value)).toString();
1747
1750
  }
1748
1751
  case "%f":
1749
- return Number.parseFloat(String(args[i++])).toString();
1752
+ return Number.parseFloat(String(args[i2++])).toString();
1750
1753
  case "%o":
1751
- return formatArg(args[i++], {
1754
+ return formatArg(args[i2++], {
1752
1755
  showHidden: true,
1753
1756
  showProxy: true
1754
1757
  });
1755
1758
  case "%O":
1756
- return formatArg(args[i++]);
1759
+ return formatArg(args[i2++]);
1757
1760
  case "%c": {
1758
- i++;
1761
+ i2++;
1759
1762
  return "";
1760
1763
  }
1761
1764
  case "%j":
1762
1765
  try {
1763
- return JSON.stringify(args[i++]);
1766
+ return JSON.stringify(args[i2++]);
1764
1767
  } catch (err) {
1765
1768
  const m = err.message;
1766
1769
  if (m.includes("circular structure") || m.includes("cyclic structures") || m.includes("cyclic object")) {
@@ -1772,7 +1775,7 @@ function baseFormat(args, options = {}) {
1772
1775
  return x;
1773
1776
  }
1774
1777
  });
1775
- for (let x = args[i]; i < len; x = args[++i]) {
1778
+ for (let x = args[i2]; i2 < len; x = args[++i2]) {
1776
1779
  if (x === null || typeof x !== "object") {
1777
1780
  str += ` ${typeof x === "symbol" ? x.toString() : x}`;
1778
1781
  } else {
@@ -1822,23 +1825,23 @@ function assertTypes(value, name, types) {
1822
1825
  function filterOutComments(s) {
1823
1826
  const result = [];
1824
1827
  let commentState = "none";
1825
- for (let i = 0; i < s.length; ++i) {
1828
+ for (let i2 = 0; i2 < s.length; ++i2) {
1826
1829
  if (commentState === "singleline") {
1827
- if (s[i] === "\n") {
1830
+ if (s[i2] === "\n") {
1828
1831
  commentState = "none";
1829
1832
  }
1830
1833
  } else if (commentState === "multiline") {
1831
- if (s[i - 1] === "*" && s[i] === "/") {
1834
+ if (s[i2 - 1] === "*" && s[i2] === "/") {
1832
1835
  commentState = "none";
1833
1836
  }
1834
1837
  } else if (commentState === "none") {
1835
- if (s[i] === "/" && s[i + 1] === "/") {
1838
+ if (s[i2] === "/" && s[i2 + 1] === "/") {
1836
1839
  commentState = "singleline";
1837
- } else if (s[i] === "/" && s[i + 1] === "*") {
1840
+ } else if (s[i2] === "/" && s[i2 + 1] === "*") {
1838
1841
  commentState = "multiline";
1839
- i += 2;
1842
+ i2 += 2;
1840
1843
  } else {
1841
- result.push(s[i]);
1844
+ result.push(s[i2]);
1842
1845
  }
1843
1846
  }
1844
1847
  }
@@ -1888,19 +1891,19 @@ function isNegativeNaN(val) {
1888
1891
  const isNegative = u32[1] >>> 31 === 1;
1889
1892
  return isNegative;
1890
1893
  }
1891
- function ordinal(i) {
1892
- const j = i % 10;
1893
- const k = i % 100;
1894
+ function ordinal(i2) {
1895
+ const j = i2 % 10;
1896
+ const k = i2 % 100;
1894
1897
  if (j === 1 && k !== 11) {
1895
- return `${i}st`;
1898
+ return `${i2}st`;
1896
1899
  }
1897
1900
  if (j === 2 && k !== 12) {
1898
- return `${i}nd`;
1901
+ return `${i2}nd`;
1899
1902
  }
1900
1903
  if (j === 3 && k !== 13) {
1901
- return `${i}rd`;
1904
+ return `${i2}rd`;
1902
1905
  }
1903
- return `${i}th`;
1906
+ return `${i2}th`;
1904
1907
  }
1905
1908
  function unique(array) {
1906
1909
  return Array.from(new Set(array));
@@ -2018,10 +2021,10 @@ const isAbsolute$1 = function(p) {
2018
2021
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2019
2022
  var intToChar = new Uint8Array(64);
2020
2023
  var charToInt = new Uint8Array(128);
2021
- for (let i = 0; i < chars.length; i++) {
2022
- const c = chars.charCodeAt(i);
2023
- intToChar[i] = c;
2024
- charToInt[c] = i;
2024
+ for (let i2 = 0; i2 < chars.length; i2++) {
2025
+ const c = chars.charCodeAt(i2);
2026
+ intToChar[i2] = c;
2027
+ charToInt[c] = i2;
2025
2028
  }
2026
2029
  const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
2027
2030
  const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
@@ -2073,13 +2076,13 @@ function parseSingleFFOrSafariStack(raw) {
2073
2076
  let atIndex = -1;
2074
2077
  let locationPart = "";
2075
2078
  let functionName;
2076
- for (let i = 0; i < line.length; i++) {
2077
- if (line[i] === "@") {
2078
- const candidateLocation = line.slice(i + 1);
2079
+ for (let i2 = 0; i2 < line.length; i2++) {
2080
+ if (line[i2] === "@") {
2081
+ const candidateLocation = line.slice(i2 + 1);
2079
2082
  if (candidateLocation.includes(":") && candidateLocation.length >= 3) {
2080
- atIndex = i;
2083
+ atIndex = i2;
2081
2084
  locationPart = candidateLocation;
2082
- functionName = i > 0 ? line.slice(0, i) : void 0;
2085
+ functionName = i2 > 0 ? line.slice(0, i2) : void 0;
2083
2086
  break;
2084
2087
  }
2085
2088
  }
@@ -2317,10 +2320,10 @@ class TestFixtures {
2317
2320
  TestFixtures._definitions.length = 0;
2318
2321
  }
2319
2322
  static getWorkerContexts() {
2320
- return TestFixtures._definitions.map((f2) => f2.getWorkerContext());
2323
+ return TestFixtures._definitions.map((f) => f.getWorkerContext());
2321
2324
  }
2322
2325
  static getFileContexts(file) {
2323
- return TestFixtures._definitions.map((f2) => f2.getFileContext(file));
2326
+ return TestFixtures._definitions.map((f) => f.getFileContext(file));
2324
2327
  }
2325
2328
  static isFixtureOptions(obj) {
2326
2329
  return isObject(obj) && Object.keys(obj).some((key) => TestFixtures._fixtureOptionKeys.includes(key));
@@ -2490,7 +2493,7 @@ function withFixtures(fn, options) {
2490
2493
  const usedFixtures = [];
2491
2494
  const usedProps = getUsedProps(fn);
2492
2495
  for (const fixture of registrations.values()) {
2493
- if (fixture.auto || usedProps.has(fixture.name)) {
2496
+ if (isAutoFixture(fixture, options) || usedProps.has(fixture.name)) {
2494
2497
  usedFixtures.push(fixture);
2495
2498
  }
2496
2499
  }
@@ -2506,9 +2509,9 @@ function withFixtures(fn, options) {
2506
2509
  return fn(context);
2507
2510
  }
2508
2511
  if (options == null ? void 0 : options.suiteHook) {
2509
- const testScopedFixtures = pendingFixtures.filter((f2) => f2.scope === "test");
2512
+ const testScopedFixtures = pendingFixtures.filter((f) => f.scope === "test");
2510
2513
  if (testScopedFixtures.length > 0) {
2511
- const fixtureNames = testScopedFixtures.map((f2) => `"${f2.name}"`).join(", ");
2514
+ const fixtureNames = testScopedFixtures.map((f) => `"${f.name}"`).join(", ");
2512
2515
  const alternativeHook = {
2513
2516
  aroundAll: "aroundEach",
2514
2517
  beforeAll: "beforeEach",
@@ -2544,6 +2547,15 @@ function withFixtures(fn, options) {
2544
2547
  return fn(context);
2545
2548
  };
2546
2549
  }
2550
+ function isAutoFixture(fixture, options) {
2551
+ if (!fixture.auto) {
2552
+ return false;
2553
+ }
2554
+ if ((options == null ? void 0 : options.suiteHook) && fixture.scope === "test") {
2555
+ return false;
2556
+ }
2557
+ return true;
2558
+ }
2547
2559
  function isFixtureFunction(value) {
2548
2560
  return typeof value === "function";
2549
2561
  }
@@ -2711,17 +2723,17 @@ function splitByComma(s) {
2711
2723
  const result = [];
2712
2724
  const stack = [];
2713
2725
  let start = 0;
2714
- for (let i = 0; i < s.length; i++) {
2715
- if (s[i] === "{" || s[i] === "[") {
2716
- stack.push(s[i] === "{" ? "}" : "]");
2717
- } else if (s[i] === stack.at(-1)) {
2726
+ for (let i2 = 0; i2 < s.length; i2++) {
2727
+ if (s[i2] === "{" || s[i2] === "[") {
2728
+ stack.push(s[i2] === "{" ? "}" : "]");
2729
+ } else if (s[i2] === stack.at(-1)) {
2718
2730
  stack.pop();
2719
- } else if (!stack.length && s[i] === ",") {
2720
- const token = s.substring(start, i).trim();
2731
+ } else if (!stack.length && s[i2] === ",") {
2732
+ const token = s.substring(start, i2).trim();
2721
2733
  if (token) {
2722
2734
  result.push(token);
2723
2735
  }
2724
- start = i + 1;
2736
+ start = i2 + 1;
2725
2737
  }
2726
2738
  }
2727
2739
  const lastToken = s.substring(start).trim();
@@ -2866,8 +2878,8 @@ function generateHash(str) {
2866
2878
  if (str.length === 0) {
2867
2879
  return `${hash}`;
2868
2880
  }
2869
- for (let i = 0; i < str.length; i++) {
2870
- const char = str.charCodeAt(i);
2881
+ for (let i2 = 0; i2 < str.length; i2++) {
2882
+ const char = str.charCodeAt(i2);
2871
2883
  hash = (hash << 5) - hash + char;
2872
2884
  hash = hash & hash;
2873
2885
  }
@@ -3159,8 +3171,8 @@ function createSuiteCollector(name, factory = () => {
3159
3171
  await runWithSuite(collector, () => factory(test2));
3160
3172
  }
3161
3173
  const allChildren = [];
3162
- for (const i of tasks) {
3163
- allChildren.push(i.type === "collector" ? await i.collect(file) : i);
3174
+ for (const i2 of tasks) {
3175
+ allChildren.push(i2.type === "collector" ? await i2.collect(file) : i2);
3164
3176
  }
3165
3177
  suite2.tasks = allChildren;
3166
3178
  return suite2;
@@ -3226,19 +3238,19 @@ function createSuite() {
3226
3238
  const arrayOnlyCases = cases.every(Array.isArray);
3227
3239
  const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
3228
3240
  const fnFirst = typeof optionsOrFn === "function";
3229
- cases.forEach((i, idx) => {
3230
- const items = Array.isArray(i) ? i : [i];
3241
+ cases.forEach((i2, idx) => {
3242
+ const items = Array.isArray(i2) ? i2 : [i2];
3231
3243
  if (fnFirst) {
3232
3244
  if (arrayOnlyCases) {
3233
3245
  suite2(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
3234
3246
  } else {
3235
- suite2(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
3247
+ suite2(formatTitle(_name, items, idx), handler ? () => handler(i2) : void 0, options.timeout);
3236
3248
  }
3237
3249
  } else {
3238
3250
  if (arrayOnlyCases) {
3239
3251
  suite2(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
3240
3252
  } else {
3241
- suite2(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
3253
+ suite2(formatTitle(_name, items, idx), options, handler ? () => handler(i2) : void 0);
3242
3254
  }
3243
3255
  }
3244
3256
  });
@@ -3282,19 +3294,19 @@ function createTaskCollector(fn) {
3282
3294
  const arrayOnlyCases = cases.every(Array.isArray);
3283
3295
  const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
3284
3296
  const fnFirst = typeof optionsOrFn === "function";
3285
- cases.forEach((i, idx) => {
3286
- const items = Array.isArray(i) ? i : [i];
3297
+ cases.forEach((i2, idx) => {
3298
+ const items = Array.isArray(i2) ? i2 : [i2];
3287
3299
  if (fnFirst) {
3288
3300
  if (arrayOnlyCases) {
3289
3301
  test2(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
3290
3302
  } else {
3291
- test2(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
3303
+ test2(formatTitle(_name, items, idx), handler ? () => handler(i2) : void 0, options.timeout);
3292
3304
  }
3293
3305
  } else {
3294
3306
  if (arrayOnlyCases) {
3295
3307
  test2(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
3296
3308
  } else {
3297
- test2(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
3309
+ test2(formatTitle(_name, items, idx), options, handler ? () => handler(i2) : void 0);
3298
3310
  }
3299
3311
  }
3300
3312
  });
@@ -3423,12 +3435,12 @@ function formatTitle(template, items, idx) {
3423
3435
  const count = template.split("%").length - 1;
3424
3436
  if (template.includes("%f")) {
3425
3437
  const placeholders = template.match(/%f/g) || [];
3426
- placeholders.forEach((_, i2) => {
3427
- if (isNegativeNaN(items[i2]) || Object.is(items[i2], -0)) {
3438
+ placeholders.forEach((_, i3) => {
3439
+ if (isNegativeNaN(items[i3]) || Object.is(items[i3], -0)) {
3428
3440
  let occurrence = 0;
3429
3441
  template = template.replace(/%f/g, (match) => {
3430
3442
  occurrence++;
3431
- return occurrence === i2 + 1 ? "-%f" : match;
3443
+ return occurrence === i3 + 1 ? "-%f" : match;
3432
3444
  });
3433
3445
  }
3434
3446
  });
@@ -3447,14 +3459,14 @@ function formatTitle(template, items, idx) {
3447
3459
  });
3448
3460
  }
3449
3461
  let output = "";
3450
- let i = 0;
3462
+ let i2 = 0;
3451
3463
  handleRegexMatch(
3452
3464
  template,
3453
3465
  formatRegExp,
3454
3466
  // format "%"
3455
3467
  (match) => {
3456
- if (i < count) {
3457
- output += format(match[0], items[i++]);
3468
+ if (i2 < count) {
3469
+ output += format(match[0], items[i2++]);
3458
3470
  } else {
3459
3471
  output += match[0];
3460
3472
  }
@@ -3480,12 +3492,12 @@ function handleRegexMatch(input, regex, onMatch, onNonMatch) {
3480
3492
  }
3481
3493
  }
3482
3494
  function formatTemplateString(cases, args) {
3483
- const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i) => i.split("|"))[0];
3495
+ const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i2) => i2.split("|"))[0];
3484
3496
  const res = [];
3485
- for (let i = 0; i < Math.floor(args.length / header.length); i++) {
3497
+ for (let i2 = 0; i2 < Math.floor(args.length / header.length); i2++) {
3486
3498
  const oneCase = {};
3487
3499
  for (let j = 0; j < header.length; j++) {
3488
- oneCase[header[j]] = args[i * header.length + j];
3500
+ oneCase[header[j]] = args[i2 * header.length + j];
3489
3501
  }
3490
3502
  res.push(oneCase);
3491
3503
  }
@@ -3708,41 +3720,41 @@ async function recordArtifact(task, artifact) {
3708
3720
  return resolvedArtifact;
3709
3721
  }
3710
3722
  const table = [];
3711
- for (let i = 65; i < 91; i++) {
3712
- table.push(String.fromCharCode(i));
3723
+ for (let i2 = 65; i2 < 91; i2++) {
3724
+ table.push(String.fromCharCode(i2));
3713
3725
  }
3714
- for (let i = 97; i < 123; i++) {
3715
- table.push(String.fromCharCode(i));
3726
+ for (let i2 = 97; i2 < 123; i2++) {
3727
+ table.push(String.fromCharCode(i2));
3716
3728
  }
3717
- for (let i = 0; i < 10; i++) {
3718
- table.push(i.toString(10));
3729
+ for (let i2 = 0; i2 < 10; i2++) {
3730
+ table.push(i2.toString(10));
3719
3731
  }
3720
3732
  table.push("+", "/");
3721
3733
  function encodeUint8Array(bytes) {
3722
3734
  let base64 = "";
3723
3735
  const len = bytes.byteLength;
3724
- for (let i = 0; i < len; i += 3) {
3725
- if (len === i + 1) {
3726
- const a = (bytes[i] & 252) >> 2;
3727
- const b = (bytes[i] & 3) << 4;
3736
+ for (let i2 = 0; i2 < len; i2 += 3) {
3737
+ if (len === i2 + 1) {
3738
+ const a = (bytes[i2] & 252) >> 2;
3739
+ const b2 = (bytes[i2] & 3) << 4;
3728
3740
  base64 += table[a];
3729
- base64 += table[b];
3741
+ base64 += table[b2];
3730
3742
  base64 += "==";
3731
- } else if (len === i + 2) {
3732
- const a = (bytes[i] & 252) >> 2;
3733
- const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
3734
- const c = (bytes[i + 1] & 15) << 2;
3743
+ } else if (len === i2 + 2) {
3744
+ const a = (bytes[i2] & 252) >> 2;
3745
+ const b2 = (bytes[i2] & 3) << 4 | (bytes[i2 + 1] & 240) >> 4;
3746
+ const c = (bytes[i2 + 1] & 15) << 2;
3735
3747
  base64 += table[a];
3736
- base64 += table[b];
3748
+ base64 += table[b2];
3737
3749
  base64 += table[c];
3738
3750
  base64 += "=";
3739
3751
  } else {
3740
- const a = (bytes[i] & 252) >> 2;
3741
- const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
3742
- const c = (bytes[i + 1] & 15) << 2 | (bytes[i + 2] & 192) >> 6;
3743
- const d2 = bytes[i + 2] & 63;
3752
+ const a = (bytes[i2] & 252) >> 2;
3753
+ const b2 = (bytes[i2] & 3) << 4 | (bytes[i2 + 1] & 240) >> 4;
3754
+ const c = (bytes[i2 + 1] & 15) << 2 | (bytes[i2 + 2] & 192) >> 6;
3755
+ const d2 = bytes[i2 + 2] & 63;
3744
3756
  base64 += table[a];
3745
- base64 += table[b];
3757
+ base64 += table[b2];
3746
3758
  base64 += table[c];
3747
3759
  base64 += table[d2];
3748
3760
  }
@@ -3772,9 +3784,15 @@ function manageArtifactAttachment(attachment) {
3772
3784
  if (attachment.body && attachment.path) {
3773
3785
  throw new TypeError(`Test attachment requires only one of "body" or "path" to be set. Both are specified.`);
3774
3786
  }
3787
+ if (attachment.path && attachment.bodyEncoding) {
3788
+ throw new TypeError(`Test attachment with "path" should not have "bodyEncoding" specified.`);
3789
+ }
3775
3790
  if (attachment.body instanceof Uint8Array) {
3776
3791
  attachment.body = encodeUint8Array(attachment.body);
3777
3792
  }
3793
+ if (attachment.body != null) {
3794
+ attachment.bodyEncoding ?? (attachment.bodyEncoding = "base64");
3795
+ }
3778
3796
  }
3779
3797
  async function importId(id) {
3780
3798
  const name = `/@id/${id}`.replace(/\\/g, "/");