@hughescr/stryker-bun-runner 1.3.7 → 1.4.0

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.
package/dist/index.js CHANGED
@@ -18,13 +18,15 @@ var __toESM = (mod, isNodeMode, target) => {
18
18
  return cached;
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
21
+ const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ if (mod && typeof mod === "object" || typeof mod === "function") {
23
+ for (let key of __getOwnPropNames(mod))
24
+ if (!__hasOwnProp.call(to, key))
25
+ __defProp(to, key, {
26
+ get: __accessProp.bind(mod, key),
27
+ enumerable: true
28
+ });
29
+ }
28
30
  if (canCache)
29
31
  cache.set(mod, to);
30
32
  return to;
@@ -33,7 +35,7 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
33
35
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
34
36
 
35
37
  // node_modules/picomatch/lib/constants.js
36
- var require_constants = __commonJS((exports, module) => {
38
+ var require_constants = __commonJS(function(exports, module) {
37
39
  var WIN_SLASH = "\\\\/";
38
40
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
39
41
  var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -178,7 +180,7 @@ var require_constants = __commonJS((exports, module) => {
178
180
  });
179
181
 
180
182
  // node_modules/picomatch/lib/utils.js
181
- var require_utils = __commonJS((exports) => {
183
+ var require_utils = __commonJS(function(exports) {
182
184
  var {
183
185
  REGEX_BACKSLASH,
184
186
  REGEX_REMOVE_BACKSLASH,
@@ -241,7 +243,7 @@ var require_utils = __commonJS((exports) => {
241
243
  });
242
244
 
243
245
  // node_modules/picomatch/lib/scan.js
244
- var require_scan = __commonJS((exports, module) => {
246
+ var require_scan = __commonJS(function(exports, module) {
245
247
  var utils = require_utils();
246
248
  var {
247
249
  CHAR_ASTERISK,
@@ -273,7 +275,7 @@ var require_scan = __commonJS((exports, module) => {
273
275
  const length = input.length - 1;
274
276
  const scanToEnd = opts.parts === true || opts.scanToEnd === true;
275
277
  const slashes = [];
276
- const tokens3 = [];
278
+ const tokens = [];
277
279
  const parts = [];
278
280
  let str = input;
279
281
  let index = -1;
@@ -357,7 +359,7 @@ var require_scan = __commonJS((exports, module) => {
357
359
  }
358
360
  if (code === CHAR_FORWARD_SLASH) {
359
361
  slashes.push(index);
360
- tokens3.push(token);
362
+ tokens.push(token);
361
363
  token = { value: "", depth: 0, isGlob: false };
362
364
  if (finished === true)
363
365
  continue;
@@ -513,9 +515,9 @@ var require_scan = __commonJS((exports, module) => {
513
515
  if (opts.tokens === true) {
514
516
  state.maxDepth = 0;
515
517
  if (!isPathSeparator(code)) {
516
- tokens3.push(token);
518
+ tokens.push(token);
517
519
  }
518
- state.tokens = tokens3;
520
+ state.tokens = tokens;
519
521
  }
520
522
  if (opts.parts === true || opts.tokens === true) {
521
523
  let prevIndex;
@@ -525,13 +527,13 @@ var require_scan = __commonJS((exports, module) => {
525
527
  const value = input.slice(n, i);
526
528
  if (opts.tokens) {
527
529
  if (idx === 0 && start !== 0) {
528
- tokens3[idx].isPrefix = true;
529
- tokens3[idx].value = prefix;
530
+ tokens[idx].isPrefix = true;
531
+ tokens[idx].value = prefix;
530
532
  } else {
531
- tokens3[idx].value = value;
533
+ tokens[idx].value = value;
532
534
  }
533
- depth(tokens3[idx]);
534
- state.maxDepth += tokens3[idx].depth;
535
+ depth(tokens[idx]);
536
+ state.maxDepth += tokens[idx].depth;
535
537
  }
536
538
  if (idx !== 0 || value !== "") {
537
539
  parts.push(value);
@@ -542,9 +544,9 @@ var require_scan = __commonJS((exports, module) => {
542
544
  const value = input.slice(prevIndex + 1);
543
545
  parts.push(value);
544
546
  if (opts.tokens) {
545
- tokens3[tokens3.length - 1].value = value;
546
- depth(tokens3[tokens3.length - 1]);
547
- state.maxDepth += tokens3[tokens3.length - 1].depth;
547
+ tokens[tokens.length - 1].value = value;
548
+ depth(tokens[tokens.length - 1]);
549
+ state.maxDepth += tokens[tokens.length - 1].depth;
548
550
  }
549
551
  }
550
552
  state.slashes = slashes;
@@ -556,7 +558,7 @@ var require_scan = __commonJS((exports, module) => {
556
558
  });
557
559
 
558
560
  // node_modules/picomatch/lib/parse.js
559
- var require_parse = __commonJS((exports, module) => {
561
+ var require_parse = __commonJS(function(exports, module) {
560
562
  var constants = require_constants();
561
563
  var utils = require_utils();
562
564
  var {
@@ -739,7 +741,7 @@ var require_parse = __commonJS((exports, module) => {
739
741
  if (!match || match.type !== "*") {
740
742
  return;
741
743
  }
742
- const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
744
+ const branches = splitTopLevel(match.body).map((branch) => branch.trim());
743
745
  if (branches.length !== 1) {
744
746
  return;
745
747
  }
@@ -801,7 +803,7 @@ var require_parse = __commonJS((exports, module) => {
801
803
  throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
802
804
  }
803
805
  const bos = { type: "bos", value: "", output: opts.prepend || "" };
804
- const tokens3 = [bos];
806
+ const tokens = [bos];
805
807
  const capture = opts.capture ? "" : "?:";
806
808
  const PLATFORM_CHARS = constants.globChars(opts.windows);
807
809
  const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
@@ -819,8 +821,8 @@ var require_parse = __commonJS((exports, module) => {
819
821
  STAR,
820
822
  START_ANCHOR
821
823
  } = PLATFORM_CHARS;
822
- const globstar = (opts2) => {
823
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
824
+ const globstar = (opts) => {
825
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
824
826
  };
825
827
  const nodot = opts.dot ? "" : NO_DOT;
826
828
  const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
@@ -846,7 +848,7 @@ var require_parse = __commonJS((exports, module) => {
846
848
  parens: 0,
847
849
  quotes: 0,
848
850
  globstar: false,
849
- tokens: tokens3
851
+ tokens
850
852
  };
851
853
  input = utils.removePrefix(input, state);
852
854
  len = input.length;
@@ -859,8 +861,8 @@ var require_parse = __commonJS((exports, module) => {
859
861
  const peek = state.peek = (n = 1) => input[state.index + n];
860
862
  const advance = state.advance = () => input[++state.index] || "";
861
863
  const remaining = () => input.slice(state.index + 1);
862
- const consume = (value2 = "", num = 0) => {
863
- state.consumed += value2;
864
+ const consume = (value = "", num = 0) => {
865
+ state.consumed += value;
864
866
  state.index += num;
865
867
  };
866
868
  const append = (token) => {
@@ -912,19 +914,19 @@ var require_parse = __commonJS((exports, module) => {
912
914
  return;
913
915
  }
914
916
  tok.prev = prev;
915
- tokens3.push(tok);
917
+ tokens.push(tok);
916
918
  prev = tok;
917
919
  };
918
- const extglobOpen = (type, value2) => {
919
- const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
920
+ const extglobOpen = (type, value) => {
921
+ const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: "" };
920
922
  token.prev = prev;
921
923
  token.parens = state.parens;
922
924
  token.output = state.output;
923
925
  token.startIndex = state.index;
924
- token.tokensIndex = tokens3.length;
926
+ token.tokensIndex = tokens.length;
925
927
  const output = (opts.capture ? "(" : "") + token.open;
926
928
  increment("parens");
927
- push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
929
+ push({ type, value, output: state.output ? "" : ONE_CHAR });
928
930
  push({ type: "paren", extglob: true, value: advance(), output });
929
931
  extglobs.push(token);
930
932
  };
@@ -934,14 +936,14 @@ var require_parse = __commonJS((exports, module) => {
934
936
  const analysis = analyzeRepeatedExtglob(body, opts);
935
937
  if ((token.type === "plus" || token.type === "star") && analysis.risky) {
936
938
  const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
937
- const open = tokens3[token.tokensIndex];
939
+ const open = tokens[token.tokensIndex];
938
940
  open.type = "text";
939
941
  open.value = literal;
940
942
  open.output = safeOutput || utils.escapeRegex(literal);
941
- for (let i = token.tokensIndex + 1;i < tokens3.length; i++) {
942
- tokens3[i].value = "";
943
- tokens3[i].output = "";
944
- delete tokens3[i].suffix;
943
+ for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
944
+ tokens[i].value = "";
945
+ tokens[i].output = "";
946
+ delete tokens[i].suffix;
945
947
  }
946
948
  state.output = token.output + open.output;
947
949
  state.backtrack = true;
@@ -1058,13 +1060,13 @@ var require_parse = __commonJS((exports, module) => {
1058
1060
  if (inner.includes(":")) {
1059
1061
  const idx = prev.value.lastIndexOf("[");
1060
1062
  const pre = prev.value.slice(0, idx);
1061
- const rest2 = prev.value.slice(idx + 2);
1062
- const posix = POSIX_REGEX_SOURCE[rest2];
1063
+ const rest = prev.value.slice(idx + 2);
1064
+ const posix = POSIX_REGEX_SOURCE[rest];
1063
1065
  if (posix) {
1064
1066
  prev.value = pre + posix;
1065
1067
  state.backtrack = true;
1066
1068
  advance();
1067
- if (!bos.output && tokens3.indexOf(prev) === 1) {
1069
+ if (!bos.output && tokens.indexOf(prev) === 1) {
1068
1070
  bos.output = ONE_CHAR;
1069
1071
  }
1070
1072
  continue;
@@ -1182,10 +1184,10 @@ var require_parse = __commonJS((exports, module) => {
1182
1184
  }
1183
1185
  let output = ")";
1184
1186
  if (brace.dots === true) {
1185
- const arr = tokens3.slice();
1187
+ const arr = tokens.slice();
1186
1188
  const range = [];
1187
1189
  for (let i = arr.length - 1;i >= 0; i--) {
1188
- tokens3.pop();
1190
+ tokens.pop();
1189
1191
  if (arr[i].type === "brace") {
1190
1192
  break;
1191
1193
  }
@@ -1233,7 +1235,7 @@ var require_parse = __commonJS((exports, module) => {
1233
1235
  state.start = state.index + 1;
1234
1236
  state.consumed = "";
1235
1237
  state.output = "";
1236
- tokens3.pop();
1238
+ tokens.pop();
1237
1239
  prev = bos;
1238
1240
  continue;
1239
1241
  }
@@ -1513,10 +1515,10 @@ var require_parse = __commonJS((exports, module) => {
1513
1515
  if (opts.capture) {
1514
1516
  star = `(${star})`;
1515
1517
  }
1516
- const globstar = (opts2) => {
1517
- if (opts2.noglobstar === true)
1518
+ const globstar = (opts) => {
1519
+ if (opts.noglobstar === true)
1518
1520
  return star;
1519
- return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1521
+ return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
1520
1522
  };
1521
1523
  const create = (str) => {
1522
1524
  switch (str) {
@@ -1540,10 +1542,10 @@ var require_parse = __commonJS((exports, module) => {
1540
1542
  const match = /^(.*?)\.(\w+)$/.exec(str);
1541
1543
  if (!match)
1542
1544
  return;
1543
- const source2 = create(match[1]);
1544
- if (!source2)
1545
+ const source = create(match[1]);
1546
+ if (!source)
1545
1547
  return;
1546
- return source2 + DOT_LITERAL + match[2];
1548
+ return source + DOT_LITERAL + match[2];
1547
1549
  }
1548
1550
  }
1549
1551
  };
@@ -1558,7 +1560,7 @@ var require_parse = __commonJS((exports, module) => {
1558
1560
  });
1559
1561
 
1560
1562
  // node_modules/picomatch/lib/picomatch.js
1561
- var require_picomatch = __commonJS((exports, module) => {
1563
+ var require_picomatch = __commonJS(function(exports, module) {
1562
1564
  var scan = require_scan();
1563
1565
  var parse = require_parse();
1564
1566
  var utils = require_utils();
@@ -1569,9 +1571,9 @@ var require_picomatch = __commonJS((exports, module) => {
1569
1571
  const fns = glob.map((input) => picomatch(input, options, returnState));
1570
1572
  const arrayMatcher = (str) => {
1571
1573
  for (const isMatch of fns) {
1572
- const state2 = isMatch(str);
1573
- if (state2)
1574
- return state2;
1574
+ const state = isMatch(str);
1575
+ if (state)
1576
+ return state;
1575
1577
  }
1576
1578
  return false;
1577
1579
  };
@@ -1698,7 +1700,7 @@ var require_picomatch = __commonJS((exports, module) => {
1698
1700
  });
1699
1701
 
1700
1702
  // node_modules/picomatch/index.js
1701
- var require_picomatch2 = __commonJS((exports, module) => {
1703
+ var require_picomatch2 = __commonJS(function(exports, module) {
1702
1704
  var pico = require_picomatch();
1703
1705
  var utils = require_utils();
1704
1706
  function picomatch(glob, options, returnState = false) {
@@ -1712,7 +1714,7 @@ var require_picomatch2 = __commonJS((exports, module) => {
1712
1714
  });
1713
1715
 
1714
1716
  // node_modules/ws/lib/constants.js
1715
- var require_constants2 = __commonJS((exports, module) => {
1717
+ var require_constants2 = __commonJS(function(exports, module) {
1716
1718
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
1717
1719
  var hasBlob = typeof Blob !== "undefined";
1718
1720
  if (hasBlob)
@@ -1732,7 +1734,7 @@ var require_constants2 = __commonJS((exports, module) => {
1732
1734
  });
1733
1735
 
1734
1736
  // node_modules/ws/lib/buffer-util.js
1735
- var require_buffer_util = __commonJS((exports, module) => {
1737
+ var require_buffer_util = __commonJS(function(exports, module) {
1736
1738
  var { EMPTY_BUFFER } = require_constants2();
1737
1739
  var FastBuffer = Buffer[Symbol.species];
1738
1740
  function concat(list, totalLength) {
@@ -1740,17 +1742,17 @@ var require_buffer_util = __commonJS((exports, module) => {
1740
1742
  return EMPTY_BUFFER;
1741
1743
  if (list.length === 1)
1742
1744
  return list[0];
1743
- const target2 = Buffer.allocUnsafe(totalLength);
1745
+ const target = Buffer.allocUnsafe(totalLength);
1744
1746
  let offset = 0;
1745
1747
  for (let i = 0;i < list.length; i++) {
1746
1748
  const buf = list[i];
1747
- target2.set(buf, offset);
1749
+ target.set(buf, offset);
1748
1750
  offset += buf.length;
1749
1751
  }
1750
1752
  if (offset < totalLength) {
1751
- return new FastBuffer(target2.buffer, target2.byteOffset, offset);
1753
+ return new FastBuffer(target.buffer, target.byteOffset, offset);
1752
1754
  }
1753
- return target2;
1755
+ return target;
1754
1756
  }
1755
1757
  function _mask(source, mask, output, offset, length) {
1756
1758
  for (let i = 0;i < length; i++) {
@@ -1793,11 +1795,11 @@ var require_buffer_util = __commonJS((exports, module) => {
1793
1795
  if (!process.env.WS_NO_BUFFER_UTIL) {
1794
1796
  try {
1795
1797
  const bufferUtil = (()=>{throw new Error("Cannot require module "+"bufferutil");})();
1796
- module.exports.mask = function(source, mask, output, offset, length) {
1798
+ module.exports.mask = function(source, mask2, output, offset, length) {
1797
1799
  if (length < 48)
1798
- _mask(source, mask, output, offset, length);
1800
+ _mask(source, mask2, output, offset, length);
1799
1801
  else
1800
- bufferUtil.mask(source, mask, output, offset, length);
1802
+ bufferUtil.mask(source, mask2, output, offset, length);
1801
1803
  };
1802
1804
  module.exports.unmask = function(buffer, mask) {
1803
1805
  if (buffer.length < 32)
@@ -1810,7 +1812,7 @@ var require_buffer_util = __commonJS((exports, module) => {
1810
1812
  });
1811
1813
 
1812
1814
  // node_modules/ws/lib/limiter.js
1813
- var require_limiter = __commonJS((exports, module) => {
1815
+ var require_limiter = __commonJS(function(exports, module) {
1814
1816
  var kDone = Symbol("kDone");
1815
1817
  var kRun = Symbol("kRun");
1816
1818
 
@@ -1842,7 +1844,7 @@ var require_limiter = __commonJS((exports, module) => {
1842
1844
  });
1843
1845
 
1844
1846
  // node_modules/ws/lib/permessage-deflate.js
1845
- var require_permessage_deflate = __commonJS((exports, module) => {
1847
+ var require_permessage_deflate = __commonJS(function(exports, module) {
1846
1848
  var zlib = __require("zlib");
1847
1849
  var bufferUtil = require_buffer_util();
1848
1850
  var Limiter = require_limiter();
@@ -1902,11 +1904,11 @@ var require_permessage_deflate = __commonJS((exports, module) => {
1902
1904
  this._inflate = null;
1903
1905
  }
1904
1906
  if (this._deflate) {
1905
- const callback2 = this._deflate[kCallback];
1907
+ const callback = this._deflate[kCallback];
1906
1908
  this._deflate.close();
1907
1909
  this._deflate = null;
1908
- if (callback2) {
1909
- callback2(new Error("The deflate stream was closed while data was being processed"));
1910
+ if (callback) {
1911
+ callback(new Error("The deflate stream was closed while data was being processed"));
1910
1912
  }
1911
1913
  }
1912
1914
  }
@@ -1987,23 +1989,23 @@ var require_permessage_deflate = __commonJS((exports, module) => {
1987
1989
  });
1988
1990
  return configurations;
1989
1991
  }
1990
- decompress(data, fin, callback2) {
1992
+ decompress(data, fin, callback) {
1991
1993
  zlibLimiter.add((done) => {
1992
1994
  this._decompress(data, fin, (err, result) => {
1993
1995
  done();
1994
- callback2(err, result);
1996
+ callback(err, result);
1995
1997
  });
1996
1998
  });
1997
1999
  }
1998
- compress(data, fin, callback2) {
2000
+ compress(data, fin, callback) {
1999
2001
  zlibLimiter.add((done) => {
2000
2002
  this._compress(data, fin, (err, result) => {
2001
2003
  done();
2002
- callback2(err, result);
2004
+ callback(err, result);
2003
2005
  });
2004
2006
  });
2005
2007
  }
2006
- _decompress(data, fin, callback2) {
2008
+ _decompress(data, fin, callback) {
2007
2009
  const endpoint = this._isServer ? "client" : "server";
2008
2010
  if (!this._inflate) {
2009
2011
  const key = `${endpoint}_max_window_bits`;
@@ -2018,7 +2020,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2018
2020
  this._inflate.on("error", inflateOnError);
2019
2021
  this._inflate.on("data", inflateOnData);
2020
2022
  }
2021
- this._inflate[kCallback] = callback2;
2023
+ this._inflate[kCallback] = callback;
2022
2024
  this._inflate.write(data);
2023
2025
  if (fin)
2024
2026
  this._inflate.write(TRAILER);
@@ -2027,10 +2029,10 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2027
2029
  if (err) {
2028
2030
  this._inflate.close();
2029
2031
  this._inflate = null;
2030
- callback2(err);
2032
+ callback(err);
2031
2033
  return;
2032
2034
  }
2033
- const data2 = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]);
2035
+ const data = bufferUtil.concat(this._inflate[kBuffers], this._inflate[kTotalLength]);
2034
2036
  if (this._inflate._readableState.endEmitted) {
2035
2037
  this._inflate.close();
2036
2038
  this._inflate = null;
@@ -2041,10 +2043,10 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2041
2043
  this._inflate.reset();
2042
2044
  }
2043
2045
  }
2044
- callback2(null, data2);
2046
+ callback(null, data);
2045
2047
  });
2046
2048
  }
2047
- _compress(data, fin, callback2) {
2049
+ _compress(data, fin, callback) {
2048
2050
  const endpoint = this._isServer ? "server" : "client";
2049
2051
  if (!this._deflate) {
2050
2052
  const key = `${endpoint}_max_window_bits`;
@@ -2057,15 +2059,15 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2057
2059
  this._deflate[kBuffers] = [];
2058
2060
  this._deflate.on("data", deflateOnData);
2059
2061
  }
2060
- this._deflate[kCallback] = callback2;
2062
+ this._deflate[kCallback] = callback;
2061
2063
  this._deflate.write(data);
2062
2064
  this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
2063
2065
  if (!this._deflate) {
2064
2066
  return;
2065
2067
  }
2066
- let data2 = bufferUtil.concat(this._deflate[kBuffers], this._deflate[kTotalLength]);
2068
+ let data = bufferUtil.concat(this._deflate[kBuffers], this._deflate[kTotalLength]);
2067
2069
  if (fin) {
2068
- data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4);
2070
+ data = new FastBuffer(data.buffer, data.byteOffset, data.length - 4);
2069
2071
  }
2070
2072
  this._deflate[kCallback] = null;
2071
2073
  this._deflate[kTotalLength] = 0;
@@ -2073,7 +2075,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2073
2075
  if (fin && this.params[`${endpoint}_no_context_takeover`]) {
2074
2076
  this._deflate.reset();
2075
2077
  }
2076
- callback2(null, data2);
2078
+ callback(null, data);
2077
2079
  });
2078
2080
  }
2079
2081
  }
@@ -2106,7 +2108,7 @@ var require_permessage_deflate = __commonJS((exports, module) => {
2106
2108
  });
2107
2109
 
2108
2110
  // node_modules/ws/lib/validation.js
2109
- var require_validation = __commonJS((exports, module) => {
2111
+ var require_validation = __commonJS(function(exports, module) {
2110
2112
  var { isUtf8 } = __require("buffer");
2111
2113
  var { hasBlob } = require_constants2();
2112
2114
  var tokenChars = [
@@ -2293,7 +2295,7 @@ var require_validation = __commonJS((exports, module) => {
2293
2295
  });
2294
2296
 
2295
2297
  // node_modules/ws/lib/receiver.js
2296
- var require_receiver = __commonJS((exports, module) => {
2298
+ var require_receiver = __commonJS(function(exports, module) {
2297
2299
  var { Writable } = __require("stream");
2298
2300
  var PerMessageDeflate = require_permessage_deflate();
2299
2301
  var {
@@ -2690,7 +2692,7 @@ var require_receiver = __commonJS((exports, module) => {
2690
2692
  });
2691
2693
 
2692
2694
  // node_modules/ws/lib/sender.js
2693
- var require_sender = __commonJS((exports, module) => {
2695
+ var require_sender = __commonJS(function(exports, module) {
2694
2696
  var { Duplex } = __require("stream");
2695
2697
  var { randomFillSync } = __require("crypto");
2696
2698
  var {
@@ -2770,32 +2772,32 @@ var require_sender = __commonJS((exports, module) => {
2770
2772
  offset += 2;
2771
2773
  payloadLength = 126;
2772
2774
  }
2773
- const target2 = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
2774
- target2[0] = options.fin ? options.opcode | 128 : options.opcode;
2775
+ const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset);
2776
+ target[0] = options.fin ? options.opcode | 128 : options.opcode;
2775
2777
  if (options.rsv1)
2776
- target2[0] |= 64;
2777
- target2[1] = payloadLength;
2778
+ target[0] |= 64;
2779
+ target[1] = payloadLength;
2778
2780
  if (payloadLength === 126) {
2779
- target2.writeUInt16BE(dataLength, 2);
2781
+ target.writeUInt16BE(dataLength, 2);
2780
2782
  } else if (payloadLength === 127) {
2781
- target2[2] = target2[3] = 0;
2782
- target2.writeUIntBE(dataLength, 4, 6);
2783
+ target[2] = target[3] = 0;
2784
+ target.writeUIntBE(dataLength, 4, 6);
2783
2785
  }
2784
2786
  if (!options.mask)
2785
- return [target2, data];
2786
- target2[1] |= 128;
2787
- target2[offset - 4] = mask[0];
2788
- target2[offset - 3] = mask[1];
2789
- target2[offset - 2] = mask[2];
2790
- target2[offset - 1] = mask[3];
2787
+ return [target, data];
2788
+ target[1] |= 128;
2789
+ target[offset - 4] = mask[0];
2790
+ target[offset - 3] = mask[1];
2791
+ target[offset - 2] = mask[2];
2792
+ target[offset - 1] = mask[3];
2791
2793
  if (skipMasking)
2792
- return [target2, data];
2794
+ return [target, data];
2793
2795
  if (merge) {
2794
- applyMask(data, mask, target2, offset, dataLength);
2795
- return [target2];
2796
+ applyMask(data, mask, target, offset, dataLength);
2797
+ return [target];
2796
2798
  }
2797
2799
  applyMask(data, mask, data, 0, dataLength);
2798
- return [target2, data];
2800
+ return [target, data];
2799
2801
  }
2800
2802
  close(code, data, mask, cb) {
2801
2803
  let buf;
@@ -3037,9 +3039,9 @@ var require_sender = __commonJS((exports, module) => {
3037
3039
  cb(err);
3038
3040
  for (let i = 0;i < sender._queue.length; i++) {
3039
3041
  const params = sender._queue[i];
3040
- const callback2 = params[params.length - 1];
3041
- if (typeof callback2 === "function")
3042
- callback2(err);
3042
+ const callback = params[params.length - 1];
3043
+ if (typeof callback === "function")
3044
+ callback(err);
3043
3045
  }
3044
3046
  }
3045
3047
  function onError(sender, err, cb) {
@@ -3049,7 +3051,7 @@ var require_sender = __commonJS((exports, module) => {
3049
3051
  });
3050
3052
 
3051
3053
  // node_modules/ws/lib/event-target.js
3052
- var require_event_target = __commonJS((exports, module) => {
3054
+ var require_event_target = __commonJS(function(exports, module) {
3053
3055
  var { kForOnEventAttribute, kListener } = require_constants2();
3054
3056
  var kCode = Symbol("kCode");
3055
3057
  var kData = Symbol("kData");
@@ -3200,7 +3202,7 @@ var require_event_target = __commonJS((exports, module) => {
3200
3202
  });
3201
3203
 
3202
3204
  // node_modules/ws/lib/extension.js
3203
- var require_extension = __commonJS((exports, module) => {
3205
+ var require_extension = __commonJS(function(exports, module) {
3204
3206
  var { tokenChars } = require_validation();
3205
3207
  function push(dest, name, elem) {
3206
3208
  if (dest[name] === undefined)
@@ -3365,7 +3367,7 @@ var require_extension = __commonJS((exports, module) => {
3365
3367
  });
3366
3368
 
3367
3369
  // node_modules/ws/lib/websocket.js
3368
- var require_websocket = __commonJS((exports, module) => {
3370
+ var require_websocket = __commonJS(function(exports, module) {
3369
3371
  var EventEmitter = __require("events");
3370
3372
  var https = __require("https");
3371
3373
  var http = __require("http");
@@ -3788,7 +3790,7 @@ var require_websocket = __commonJS((exports, module) => {
3788
3790
  }
3789
3791
  const defaultPort = isSecure ? 443 : 80;
3790
3792
  const key = randomBytes(16).toString("base64");
3791
- const request = isSecure ? https.request : http.request;
3793
+ const request3 = isSecure ? https.request : http.request;
3792
3794
  const protocolSet = new Set;
3793
3795
  let perMessageDeflate;
3794
3796
  opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
@@ -3847,8 +3849,8 @@ var require_websocket = __commonJS((exports, module) => {
3847
3849
  const headers = options && options.headers;
3848
3850
  options = { ...options, headers: {} };
3849
3851
  if (headers) {
3850
- for (const [key2, value] of Object.entries(headers)) {
3851
- options.headers[key2.toLowerCase()] = value;
3852
+ for (const [key, value] of Object.entries(headers)) {
3853
+ options.headers[key.toLowerCase()] = value;
3852
3854
  }
3853
3855
  }
3854
3856
  } else if (websocket.listenerCount("redirect") === 0) {
@@ -3864,12 +3866,12 @@ var require_websocket = __commonJS((exports, module) => {
3864
3866
  if (opts.auth && !options.headers.authorization) {
3865
3867
  options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
3866
3868
  }
3867
- req = websocket._req = request(opts);
3869
+ req = websocket._req = request3(opts);
3868
3870
  if (websocket._redirects) {
3869
3871
  websocket.emit("redirect", websocket.url, req);
3870
3872
  }
3871
3873
  } else {
3872
- req = websocket._req = request(opts);
3874
+ req = websocket._req = request3(opts);
3873
3875
  }
3874
3876
  if (opts.timeout) {
3875
3877
  req.on("timeout", () => {
@@ -4137,7 +4139,7 @@ var require_websocket = __commonJS((exports, module) => {
4137
4139
  });
4138
4140
 
4139
4141
  // node_modules/ws/lib/stream.js
4140
- var require_stream = __commonJS((exports, module) => {
4142
+ var require_stream = __commonJS(function(exports, module) {
4141
4143
  var WebSocket = require_websocket();
4142
4144
  var { Duplex } = __require("stream");
4143
4145
  function emitClose(stream) {
@@ -4180,41 +4182,41 @@ var require_stream = __commonJS((exports, module) => {
4180
4182
  return;
4181
4183
  duplex.push(null);
4182
4184
  });
4183
- duplex._destroy = function(err, callback2) {
4185
+ duplex._destroy = function(err, callback) {
4184
4186
  if (ws.readyState === ws.CLOSED) {
4185
- callback2(err);
4187
+ callback(err);
4186
4188
  process.nextTick(emitClose, duplex);
4187
4189
  return;
4188
4190
  }
4189
4191
  let called = false;
4190
- ws.once("error", function error(err2) {
4192
+ ws.once("error", function error(err) {
4191
4193
  called = true;
4192
- callback2(err2);
4194
+ callback(err);
4193
4195
  });
4194
4196
  ws.once("close", function close() {
4195
4197
  if (!called)
4196
- callback2(err);
4198
+ callback(err);
4197
4199
  process.nextTick(emitClose, duplex);
4198
4200
  });
4199
4201
  if (terminateOnDestroy)
4200
4202
  ws.terminate();
4201
4203
  };
4202
- duplex._final = function(callback2) {
4204
+ duplex._final = function(callback) {
4203
4205
  if (ws.readyState === ws.CONNECTING) {
4204
4206
  ws.once("open", function open() {
4205
- duplex._final(callback2);
4207
+ duplex._final(callback);
4206
4208
  });
4207
4209
  return;
4208
4210
  }
4209
4211
  if (ws._socket === null)
4210
4212
  return;
4211
4213
  if (ws._socket._writableState.finished) {
4212
- callback2();
4214
+ callback();
4213
4215
  if (duplex._readableState.endEmitted)
4214
4216
  duplex.destroy();
4215
4217
  } else {
4216
4218
  ws._socket.once("finish", function finish() {
4217
- callback2();
4219
+ callback();
4218
4220
  });
4219
4221
  ws.close();
4220
4222
  }
@@ -4223,14 +4225,14 @@ var require_stream = __commonJS((exports, module) => {
4223
4225
  if (ws.isPaused)
4224
4226
  ws.resume();
4225
4227
  };
4226
- duplex._write = function(chunk, encoding, callback2) {
4228
+ duplex._write = function(chunk, encoding, callback) {
4227
4229
  if (ws.readyState === ws.CONNECTING) {
4228
4230
  ws.once("open", function open() {
4229
- duplex._write(chunk, encoding, callback2);
4231
+ duplex._write(chunk, encoding, callback);
4230
4232
  });
4231
4233
  return;
4232
4234
  }
4233
- ws.send(chunk, callback2);
4235
+ ws.send(chunk, callback);
4234
4236
  };
4235
4237
  duplex.on("end", duplexOnEnd);
4236
4238
  duplex.on("error", duplexOnError);
@@ -4240,7 +4242,7 @@ var require_stream = __commonJS((exports, module) => {
4240
4242
  });
4241
4243
 
4242
4244
  // node_modules/ws/lib/subprotocol.js
4243
- var require_subprotocol = __commonJS((exports, module) => {
4245
+ var require_subprotocol = __commonJS(function(exports, module) {
4244
4246
  var { tokenChars } = require_validation();
4245
4247
  function parse(header) {
4246
4248
  const protocols = new Set;
@@ -4261,11 +4263,11 @@ var require_subprotocol = __commonJS((exports, module) => {
4261
4263
  }
4262
4264
  if (end === -1)
4263
4265
  end = i;
4264
- const protocol2 = header.slice(start, end);
4265
- if (protocols.has(protocol2)) {
4266
- throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`);
4266
+ const protocol = header.slice(start, end);
4267
+ if (protocols.has(protocol)) {
4268
+ throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`);
4267
4269
  }
4268
- protocols.add(protocol2);
4270
+ protocols.add(protocol);
4269
4271
  start = end = -1;
4270
4272
  } else {
4271
4273
  throw new SyntaxError(`Unexpected character at index ${i}`);
@@ -4285,7 +4287,7 @@ var require_subprotocol = __commonJS((exports, module) => {
4285
4287
  });
4286
4288
 
4287
4289
  // node_modules/ws/lib/websocket-server.js
4288
- var require_websocket_server = __commonJS((exports, module) => {
4290
+ var require_websocket_server = __commonJS(function(exports, module) {
4289
4291
  var EventEmitter = __require("events");
4290
4292
  var http = __require("http");
4291
4293
  var { Duplex } = __require("stream");
@@ -4301,7 +4303,7 @@ var require_websocket_server = __commonJS((exports, module) => {
4301
4303
  var CLOSED = 2;
4302
4304
 
4303
4305
  class WebSocketServer extends EventEmitter {
4304
- constructor(options, callback2) {
4306
+ constructor(options, callback) {
4305
4307
  super();
4306
4308
  options = {
4307
4309
  allowSynchronousEvents: true,
@@ -4336,7 +4338,7 @@ var require_websocket_server = __commonJS((exports, module) => {
4336
4338
  });
4337
4339
  res.end(body);
4338
4340
  });
4339
- this._server.listen(options.port, options.host, options.backlog, callback2);
4341
+ this._server.listen(options.port, options.host, options.backlog, callback);
4340
4342
  } else if (options.server) {
4341
4343
  this._server = options.server;
4342
4344
  }
@@ -4613,11 +4615,11 @@ function tokens(...tokensList) {
4613
4615
  }
4614
4616
  // node_modules/@stryker-mutator/api/dist/src/plugin/plugin-kind.js
4615
4617
  var PluginKind;
4616
- (function(PluginKind2) {
4617
- PluginKind2["Checker"] = "Checker";
4618
- PluginKind2["TestRunner"] = "TestRunner";
4619
- PluginKind2["Reporter"] = "Reporter";
4620
- PluginKind2["Ignore"] = "Ignore";
4618
+ (function(PluginKind) {
4619
+ PluginKind["Checker"] = "Checker";
4620
+ PluginKind["TestRunner"] = "TestRunner";
4621
+ PluginKind["Reporter"] = "Reporter";
4622
+ PluginKind["Ignore"] = "Ignore";
4621
4623
  })(PluginKind || (PluginKind = {}));
4622
4624
 
4623
4625
  // node_modules/@stryker-mutator/api/dist/src/plugin/plugins.js
@@ -4630,9 +4632,9 @@ function declareClassPlugin(kind, name, injectableClass) {
4630
4632
  }
4631
4633
  // node_modules/@stryker-mutator/api/dist/src/plugin/scope.js
4632
4634
  var Scope;
4633
- (function(Scope2) {
4634
- Scope2["Transient"] = "transient";
4635
- Scope2["Singleton"] = "singleton";
4635
+ (function(Scope) {
4636
+ Scope["Transient"] = "transient";
4637
+ Scope["Singleton"] = "singleton";
4636
4638
  })(Scope || (Scope = {}));
4637
4639
  // src/bun-test-runner.ts
4638
4640
  import { createHash } from "node:crypto";
@@ -4641,25 +4643,25 @@ import { tmpdir } from "node:os";
4641
4643
  import path4 from "node:path";
4642
4644
  // node_modules/@stryker-mutator/api/dist/src/test-runner/test-status.js
4643
4645
  var TestStatus;
4644
- (function(TestStatus2) {
4645
- TestStatus2[TestStatus2["Success"] = 0] = "Success";
4646
- TestStatus2[TestStatus2["Failed"] = 1] = "Failed";
4647
- TestStatus2[TestStatus2["Skipped"] = 2] = "Skipped";
4646
+ (function(TestStatus) {
4647
+ TestStatus[TestStatus["Success"] = 0] = "Success";
4648
+ TestStatus[TestStatus["Failed"] = 1] = "Failed";
4649
+ TestStatus[TestStatus["Skipped"] = 2] = "Skipped";
4648
4650
  })(TestStatus || (TestStatus = {}));
4649
4651
  // node_modules/@stryker-mutator/api/dist/src/test-runner/mutant-run-result.js
4650
4652
  var MutantRunStatus;
4651
- (function(MutantRunStatus2) {
4652
- MutantRunStatus2["Killed"] = "killed";
4653
- MutantRunStatus2["Survived"] = "survived";
4654
- MutantRunStatus2["Timeout"] = "timeout";
4655
- MutantRunStatus2["Error"] = "error";
4653
+ (function(MutantRunStatus) {
4654
+ MutantRunStatus["Killed"] = "killed";
4655
+ MutantRunStatus["Survived"] = "survived";
4656
+ MutantRunStatus["Timeout"] = "timeout";
4657
+ MutantRunStatus["Error"] = "error";
4656
4658
  })(MutantRunStatus || (MutantRunStatus = {}));
4657
4659
  // node_modules/@stryker-mutator/api/dist/src/test-runner/dry-run-status.js
4658
4660
  var DryRunStatus;
4659
- (function(DryRunStatus2) {
4660
- DryRunStatus2["Complete"] = "complete";
4661
- DryRunStatus2["Error"] = "error";
4662
- DryRunStatus2["Timeout"] = "timeout";
4661
+ (function(DryRunStatus) {
4662
+ DryRunStatus["Complete"] = "complete";
4663
+ DryRunStatus["Error"] = "error";
4664
+ DryRunStatus["Timeout"] = "timeout";
4663
4665
  })(DryRunStatus || (DryRunStatus = {}));
4664
4666
  // src/coverage/preload-generator.ts
4665
4667
  import { mkdir, unlink, readFile, writeFile } from "node:fs/promises";
@@ -5488,8 +5490,47 @@ function getCrawler(globInput, inputOptions = {}) {
5488
5490
  return patterns.length > 0 ? buildCrawler(options, patterns) : [];
5489
5491
  }
5490
5492
  async function glob(globInput, options) {
5491
- const [crawler, relative2] = getCrawler(globInput, options);
5492
- return crawler ? formatPaths(await crawler.withPromise(), relative2) : [];
5493
+ const [crawler, relative] = getCrawler(globInput, options);
5494
+ return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
5495
+ }
5496
+
5497
+ // src/utils/test-name-pattern.ts
5498
+ var MAX_TEST_NAME_PATTERN_LENGTH = 1e5;
5499
+ var TEST_FILE_EXT_PATTERN = String.raw`(?:test|spec)\.(?:[jt]sx?|[mc][jt]s)`;
5500
+ var fileExtRe = new RegExp(String.raw`\.${TEST_FILE_EXT_PATTERN}$`);
5501
+ var dedupSuffixRe = / \[\d+\]$/;
5502
+ var metaRe = /[.*+?^${}()|[\]\\/]/g;
5503
+ function escapeRegex(str) {
5504
+ return str.replaceAll(metaRe, String.raw`\$&`);
5505
+ }
5506
+ function buildTestNamePattern(testFilter, testNameIndex) {
5507
+ if (testFilter.length === 0) {
5508
+ return;
5509
+ }
5510
+ const alternatives = new Set;
5511
+ for (const id of testFilter) {
5512
+ const exact = testNameIndex?.get(id);
5513
+ if (exact !== undefined && exact.length > 0 && !exact.includes("\x00")) {
5514
+ alternatives.add(escapeRegex(exact));
5515
+ continue;
5516
+ }
5517
+ const firstSepIdx = id.indexOf(" > ");
5518
+ let name = firstSepIdx !== -1 && fileExtRe.test(id.slice(0, firstSepIdx)) ? id.slice(firstSepIdx + 3) : id;
5519
+ name = name.replace(dedupSuffixRe, "");
5520
+ name = name.replaceAll(" > ", " ");
5521
+ name = escapeRegex(name);
5522
+ if (name.length > 0) {
5523
+ alternatives.add(name);
5524
+ }
5525
+ }
5526
+ if (alternatives.size === 0) {
5527
+ return;
5528
+ }
5529
+ const pattern = `^(?:${[...alternatives].join("|")})$`;
5530
+ if (Buffer.byteLength(pattern) > MAX_TEST_NAME_PATTERN_LENGTH) {
5531
+ return;
5532
+ }
5533
+ return pattern;
5493
5534
  }
5494
5535
 
5495
5536
  // src/coverage/preload-generator.ts
@@ -5517,7 +5558,8 @@ async function resolveEagerModulesFromGlobs(mutateGlobs, cwd = process.cwd()) {
5517
5558
  });
5518
5559
  const sourceFileRe = /\.(?:tsx?|[cm]?js)$/;
5519
5560
  const dtsRe = /\.d\.[cm]?ts$/;
5520
- const filtered = paths.filter((p) => sourceFileRe.test(p) && !dtsRe.test(p));
5561
+ const testFileRe = new RegExp(String.raw`\.${TEST_FILE_EXT_PATTERN}$`);
5562
+ const filtered = paths.filter((p) => sourceFileRe.test(p) && !dtsRe.test(p) && !testFileRe.test(p));
5521
5563
  const resolved = filtered.map((p) => path.resolve(p));
5522
5564
  resolved.sort((a, b) => a.localeCompare(b));
5523
5565
  return resolved;
@@ -5650,7 +5692,7 @@ function sortDuplicateGroupByLineThenDiscovery(group, getLine, getInspectorId, d
5650
5692
  }
5651
5693
 
5652
5694
  // src/utils/test-name.ts
5653
- function normalizeTestFilePath(url) {
5695
+ function normalizeTestFilePath(url, cwd = process.cwd()) {
5654
5696
  if (!url) {
5655
5697
  return;
5656
5698
  }
@@ -5658,6 +5700,9 @@ function normalizeTestFilePath(url) {
5658
5700
  if (sandboxMatch) {
5659
5701
  return sandboxMatch[1];
5660
5702
  }
5703
+ if (url.startsWith(`${cwd}/`)) {
5704
+ return url.slice(cwd.length + 1);
5705
+ }
5661
5706
  return url;
5662
5707
  }
5663
5708
  function normalizeTestName(testName) {
@@ -6023,7 +6068,7 @@ class InspectorClient {
6023
6068
  if (this.ws) {
6024
6069
  throw new Error("Already connected");
6025
6070
  }
6026
- return new Promise((resolve3, reject) => {
6071
+ return new Promise((resolve, reject) => {
6027
6072
  const timeoutTimer = setTimeout(() => {
6028
6073
  if (this.ws) {
6029
6074
  this.ws.close();
@@ -6036,7 +6081,7 @@ class InspectorClient {
6036
6081
  ws.addEventListener("open", () => {
6037
6082
  clearTimeout(timeoutTimer);
6038
6083
  this.lastFrameReceivedAt = Date.now();
6039
- resolve3();
6084
+ resolve();
6040
6085
  });
6041
6086
  ws.addEventListener("error", () => {
6042
6087
  clearTimeout(timeoutTimer);
@@ -6058,7 +6103,7 @@ class InspectorClient {
6058
6103
  }
6059
6104
  const id = ++this.messageId;
6060
6105
  const message = { id, method, params };
6061
- return new Promise((resolve3, reject) => {
6106
+ return new Promise((resolve, reject) => {
6062
6107
  const effectiveTimeoutMs = timeoutMs ?? this.state.requestTimeout;
6063
6108
  const stallTimer = this.handlers.onRequestStall ? setTimeout(() => {
6064
6109
  if (this.pendingRequests.has(id)) {
@@ -6075,7 +6120,7 @@ class InspectorClient {
6075
6120
  }
6076
6121
  reject(new InspectorTimeoutError(`Request timeout after ${effectiveTimeoutMs}ms: ${method}`));
6077
6122
  }, effectiveTimeoutMs);
6078
- this.pendingRequests.set(id, { resolve: resolve3, reject, timer, stallTimer });
6123
+ this.pendingRequests.set(id, { resolve, reject, timer, stallTimer });
6079
6124
  try {
6080
6125
  this.ws.send(JSON.stringify(message));
6081
6126
  } catch (error) {
@@ -6120,7 +6165,7 @@ class InspectorClient {
6120
6165
  if (this.wsClosed || !this.ws) {
6121
6166
  return;
6122
6167
  }
6123
- return new Promise((resolve3) => {
6168
+ return new Promise((resolve) => {
6124
6169
  let settled = false;
6125
6170
  let timer;
6126
6171
  const finish = () => {
@@ -6133,7 +6178,7 @@ class InspectorClient {
6133
6178
  if (idx !== -1) {
6134
6179
  this.closeWaiters.splice(idx, 1);
6135
6180
  }
6136
- resolve3();
6181
+ resolve();
6137
6182
  };
6138
6183
  timer = setTimeout(() => {
6139
6184
  finish();
@@ -6333,10 +6378,15 @@ class InspectorClient {
6333
6378
  }
6334
6379
  }
6335
6380
  // src/parsers/console-parser.ts
6381
+ var fileHeaderRe = new RegExp(String.raw`^(?:::group::)?([^:]+\.${TEST_FILE_EXT_PATTERN}):$`);
6382
+ var workflowCommandRe = /^::(?:group|endgroup|error|warning|notice|debug|add-mask|add-matcher|remove-matcher)(?:::|\s|$)/;
6336
6383
  function parseFilePath(line) {
6337
- const fileMatch = /^([\w./-]+\.(?:test|spec)\.(?:ts|tsx|js|jsx|mts|mjs)):$/.exec(line);
6384
+ const fileMatch = fileHeaderRe.exec(line);
6338
6385
  return fileMatch ? fileMatch[1] : null;
6339
6386
  }
6387
+ function isWorkflowCommandLine(line) {
6388
+ return workflowCommandRe.test(line);
6389
+ }
6340
6390
  function buildTestName(testName, currentFile) {
6341
6391
  return currentFile ? `${currentFile} > ${testName}` : testName;
6342
6392
  }
@@ -6459,6 +6509,9 @@ ${stderr}`;
6459
6509
  currentFile = filePath;
6460
6510
  continue;
6461
6511
  }
6512
+ if (isWorkflowCommandLine(line)) {
6513
+ continue;
6514
+ }
6462
6515
  const parseResult = parseTestLine(line, currentFile);
6463
6516
  if (parseResult.test) {
6464
6517
  if (currentTest && collectingError) {
@@ -6474,9 +6527,7 @@ ${stderr}`;
6474
6527
  errorLines.push(line);
6475
6528
  }
6476
6529
  }
6477
- if (currentTest && collectingError) {
6478
- finalizeErrorMessage(currentTest, errorLines);
6479
- }
6530
+ finalizeErrorMessage(currentTest, errorLines);
6480
6531
  const summaryCounts = parseSummaryLines(output);
6481
6532
  counters.passed = Math.max(counters.passed, summaryCounts.passed);
6482
6533
  counters.failed = Math.max(counters.failed, summaryCounts.failed);
@@ -6496,6 +6547,16 @@ ${stderr}`;
6496
6547
  // src/process-runner.ts
6497
6548
  import { spawn as spawn2 } from "node:child_process";
6498
6549
 
6550
+ // src/utils/process-group.ts
6551
+ function killProcessGroup(pid, signal) {
6552
+ try {
6553
+ process.kill(-pid, signal);
6554
+ return true;
6555
+ } catch {
6556
+ return false;
6557
+ }
6558
+ }
6559
+
6499
6560
  // src/utils/process-rss.ts
6500
6561
  import { spawn } from "node:child_process";
6501
6562
  import { readFile as readFile3 } from "node:fs/promises";
@@ -6523,12 +6584,12 @@ function parsePsRssOutput(output) {
6523
6584
  return Number.isFinite(kb) ? kb * 1024 : null;
6524
6585
  }
6525
6586
  async function getPsRss(pid) {
6526
- return new Promise((resolve3) => {
6587
+ return new Promise((resolve) => {
6527
6588
  let child;
6528
6589
  try {
6529
6590
  child = spawn("ps", ["-o", "rss=", "-p", String(pid)], { stdio: ["ignore", "pipe", "ignore"] });
6530
6591
  } catch {
6531
- resolve3(null);
6592
+ resolve(null);
6532
6593
  return;
6533
6594
  }
6534
6595
  let output = "";
@@ -6536,16 +6597,25 @@ async function getPsRss(pid) {
6536
6597
  output += data.toString();
6537
6598
  });
6538
6599
  child.on("close", (code) => {
6539
- resolve3(code === 0 ? parsePsRssOutput(output) : null);
6600
+ resolve(code === 0 ? parsePsRssOutput(output) : null);
6540
6601
  });
6541
6602
  child.on("error", () => {
6542
- resolve3(null);
6603
+ resolve(null);
6543
6604
  });
6544
6605
  });
6545
6606
  }
6546
6607
 
6547
6608
  // src/process-runner.ts
6548
6609
  var KILL_GRACE_PERIOD_MS = 500;
6610
+ var SPAWN_DEPTH_ENV = "__STRYKER_BUN_RUNNER_DEPTH__";
6611
+ var DEFAULT_MAX_SPAWN_DEPTH = 1;
6612
+ function stripAnsi(text) {
6613
+ return text.replaceAll(/\u001B\[[0-9;?]*[\u0020-\u002F]*[\u0040-\u007E]|\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)/g, "");
6614
+ }
6615
+ function readSpawnDepth(raw) {
6616
+ const parsed = Number(raw);
6617
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : 0;
6618
+ }
6549
6619
  function stripBailArgs(bunArgs) {
6550
6620
  const sanitized = [];
6551
6621
  for (let i = 0;i < bunArgs.length; i++) {
@@ -6560,15 +6630,83 @@ function stripBailArgs(bunArgs) {
6560
6630
  }
6561
6631
  return sanitized;
6562
6632
  }
6633
+ var liveChildren = new Set;
6634
+ function killAllLiveChildren() {
6635
+ for (const child of liveChildren) {
6636
+ killProcessTree(child, "SIGKILL");
6637
+ }
6638
+ liveChildren.clear();
6639
+ }
6640
+ var CLEANUP_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
6641
+ var onCleanupSignal = (signal) => {
6642
+ killAllLiveChildren();
6643
+ removeSignalCleanup();
6644
+ process.kill(process.pid, signal);
6645
+ };
6646
+ function ensureSignalCleanup() {
6647
+ if (process.listeners(CLEANUP_SIGNALS[0]).includes(onCleanupSignal)) {
6648
+ return false;
6649
+ }
6650
+ for (const s of CLEANUP_SIGNALS) {
6651
+ process.on(s, onCleanupSignal);
6652
+ }
6653
+ return true;
6654
+ }
6655
+ function removeSignalCleanup() {
6656
+ for (const s of CLEANUP_SIGNALS) {
6657
+ process.off(s, onCleanupSignal);
6658
+ }
6659
+ }
6660
+ function killProcessTree(childProcess, signal) {
6661
+ const pid = childProcess.pid;
6662
+ if (pid === undefined || !killProcessGroup(pid, signal)) {
6663
+ childProcess.kill(signal);
6664
+ return false;
6665
+ }
6666
+ return true;
6667
+ }
6563
6668
  function killWithEscalation(childProcess, isClosed, gracePeriodMs) {
6564
- childProcess.kill("SIGTERM");
6565
- setTimeout(() => {
6669
+ const pid = childProcess.pid;
6670
+ const signalledGroup = killProcessTree(childProcess, "SIGTERM");
6671
+ let hasEscalated = false;
6672
+ const escalationHandle = setTimeout(() => {
6566
6673
  if (!isClosed()) {
6567
- childProcess.kill("SIGKILL");
6674
+ hasEscalated = true;
6675
+ killProcessTree(childProcess, "SIGKILL");
6568
6676
  }
6569
6677
  }, gracePeriodMs);
6678
+ return () => {
6679
+ clearTimeout(escalationHandle);
6680
+ if (!hasEscalated && signalledGroup && pid !== undefined) {
6681
+ hasEscalated = true;
6682
+ killProcessGroup(pid, "SIGKILL");
6683
+ }
6684
+ };
6570
6685
  }
6571
6686
  async function runBunTests(options) {
6687
+ const spawnDepth = readSpawnDepth(process.env[SPAWN_DEPTH_ENV]);
6688
+ const maxSpawnDepth = options.maxSpawnDepth ?? DEFAULT_MAX_SPAWN_DEPTH;
6689
+ if (!Number.isSafeInteger(maxSpawnDepth) || maxSpawnDepth < 1) {
6690
+ return {
6691
+ stdout: "",
6692
+ stderr: `stryker-bun-runner: invalid maxSpawnDepth=${String(maxSpawnDepth)}; expected a positive integer.`,
6693
+ exitCode: 1,
6694
+ timedOut: false,
6695
+ memoryLimitExceeded: false
6696
+ };
6697
+ }
6698
+ if (spawnDepth >= maxSpawnDepth) {
6699
+ return {
6700
+ stdout: "",
6701
+ stderr: `stryker-bun-runner: refusing to spawn \`bun test\` at nesting depth ${spawnDepth} (maxSpawnDepth=${maxSpawnDepth}). A test run spawned by this runner tried to spawn another one; this is almost always runaway recursion. See the bun.maxSpawnDepth option.`,
6702
+ exitCode: 1,
6703
+ timedOut: false,
6704
+ memoryLimitExceeded: false
6705
+ };
6706
+ }
6707
+ return spawnBunTests(options, spawnDepth);
6708
+ }
6709
+ async function spawnBunTests(options, spawnDepth) {
6572
6710
  const args = ["test"];
6573
6711
  if (options.inspectWaitPort) {
6574
6712
  args.push(`--inspect=127.0.0.1:${options.inspectWaitPort}`);
@@ -6610,7 +6748,8 @@ async function runBunTests(options) {
6610
6748
  if (options.syncPort) {
6611
6749
  env.__STRYKER_SYNC_PORT__ = String(options.syncPort);
6612
6750
  }
6613
- return new Promise((resolve3) => {
6751
+ env[SPAWN_DEPTH_ENV] = String(spawnDepth + 1);
6752
+ return new Promise((resolve) => {
6614
6753
  const stdoutChunks = [];
6615
6754
  const stderrChunks = [];
6616
6755
  let timedOut = false;
@@ -6618,34 +6757,44 @@ async function runBunTests(options) {
6618
6757
  let memoryLimitExceeded = false;
6619
6758
  let hasClosed = false;
6620
6759
  let rssIntervalHandle;
6760
+ let onLeaderExitDuringTermination;
6761
+ let onAbort;
6621
6762
  if (options.signal?.aborted) {
6622
- resolve3({ stdout: "", stderr: "", exitCode: null, timedOut: true, memoryLimitExceeded: false });
6763
+ resolve({ stdout: "", stderr: "", exitCode: null, timedOut: true, memoryLimitExceeded: false });
6623
6764
  return;
6624
6765
  }
6625
6766
  const spawnOpts = {
6626
6767
  env,
6627
6768
  stdio: ["ignore", "pipe", "pipe"],
6628
- cwd: process.cwd()
6769
+ cwd: process.cwd(),
6770
+ detached: true
6629
6771
  };
6630
6772
  const childProcess = spawn2(options.bunPath, args, spawnOpts);
6631
- const timeoutHandle = setTimeout(() => {
6632
- timedOut = true;
6773
+ liveChildren.add(childProcess);
6774
+ ensureSignalCleanup();
6775
+ const beginTermination = () => {
6776
+ if (processKilled) {
6777
+ return false;
6778
+ }
6633
6779
  processKilled = true;
6634
- killWithEscalation(childProcess, () => hasClosed, KILL_GRACE_PERIOD_MS);
6780
+ timedOut = true;
6781
+ onLeaderExitDuringTermination = killWithEscalation(childProcess, () => hasClosed, KILL_GRACE_PERIOD_MS);
6782
+ return true;
6783
+ };
6784
+ const timeoutHandle = setTimeout(() => {
6785
+ beginTermination();
6635
6786
  }, options.timeout);
6636
6787
  if (options.signal) {
6637
- const onAbort = () => {
6788
+ onAbort = () => {
6638
6789
  clearTimeout(timeoutHandle);
6639
- processKilled = true;
6640
- timedOut = true;
6641
- killWithEscalation(childProcess, () => hasClosed, KILL_GRACE_PERIOD_MS);
6790
+ beginTermination();
6642
6791
  };
6643
6792
  options.signal.addEventListener("abort", onAbort, { once: true });
6644
6793
  }
6645
6794
  if (options.maxChildRss !== undefined) {
6646
6795
  const rssLimit = options.maxChildRss;
6647
6796
  const checkMemoryCeiling = async () => {
6648
- if (hasClosed || memoryLimitExceeded) {
6797
+ if (hasClosed || processKilled) {
6649
6798
  return;
6650
6799
  }
6651
6800
  const pid = childProcess.pid;
@@ -6653,18 +6802,18 @@ async function runBunTests(options) {
6653
6802
  return;
6654
6803
  }
6655
6804
  const rssBytes = await getProcessRssBytes(pid);
6656
- if (rssBytes === null || hasClosed) {
6805
+ if (rssBytes === null || hasClosed || processKilled) {
6657
6806
  return;
6658
6807
  }
6659
6808
  if (rssBytes > rssLimit) {
6809
+ if (!beginTermination()) {
6810
+ return;
6811
+ }
6660
6812
  memoryLimitExceeded = true;
6661
- timedOut = true;
6662
- processKilled = true;
6663
6813
  if (rssIntervalHandle) {
6664
6814
  clearInterval(rssIntervalHandle);
6665
6815
  }
6666
6816
  options.onMemoryLimitExceeded?.(rssBytes);
6667
- killWithEscalation(childProcess, () => hasClosed, KILL_GRACE_PERIOD_MS);
6668
6817
  }
6669
6818
  };
6670
6819
  rssIntervalHandle = setInterval(() => {
@@ -6683,7 +6832,7 @@ async function runBunTests(options) {
6683
6832
  stderrChunks.push(data);
6684
6833
  if (options.inspectWaitPort && !inspectorUrlExtracted && options.onInspectorReady) {
6685
6834
  const text = Buffer.concat(stderrChunks).toString();
6686
- const match = /Listening:[\t\v\f\r \u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n\s*(ws:\/\/\S+)/.exec(text);
6835
+ const match = /Listening:[\t\v\f\r \u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n\s*(ws:\/\/\S+)/.exec(stripAnsi(text));
6687
6836
  if (match) {
6688
6837
  inspectorUrlExtracted = true;
6689
6838
  options.onInspectorReady(match[1]);
@@ -6691,13 +6840,21 @@ async function runBunTests(options) {
6691
6840
  }
6692
6841
  });
6693
6842
  }
6843
+ childProcess.on("exit", () => {
6844
+ onLeaderExitDuringTermination?.();
6845
+ });
6694
6846
  childProcess.on("close", (code) => {
6695
6847
  hasClosed = true;
6848
+ onLeaderExitDuringTermination?.();
6849
+ liveChildren.delete(childProcess);
6696
6850
  clearTimeout(timeoutHandle);
6851
+ if (options.signal && onAbort) {
6852
+ options.signal.removeEventListener("abort", onAbort);
6853
+ }
6697
6854
  if (rssIntervalHandle) {
6698
6855
  clearInterval(rssIntervalHandle);
6699
6856
  }
6700
- resolve3({
6857
+ resolve({
6701
6858
  stdout: Buffer.concat(stdoutChunks).toString(),
6702
6859
  stderr: Buffer.concat(stderrChunks).toString(),
6703
6860
  exitCode: processKilled ? null : code,
@@ -6707,12 +6864,17 @@ async function runBunTests(options) {
6707
6864
  });
6708
6865
  childProcess.on("error", (error) => {
6709
6866
  hasClosed = true;
6867
+ onLeaderExitDuringTermination?.();
6868
+ liveChildren.delete(childProcess);
6710
6869
  clearTimeout(timeoutHandle);
6870
+ if (options.signal && onAbort) {
6871
+ options.signal.removeEventListener("abort", onAbort);
6872
+ }
6711
6873
  if (rssIntervalHandle) {
6712
6874
  clearInterval(rssIntervalHandle);
6713
6875
  }
6714
6876
  const stderrOutput = Buffer.concat(stderrChunks).toString();
6715
- resolve3({
6877
+ resolve({
6716
6878
  stdout: Buffer.concat(stdoutChunks).toString(),
6717
6879
  stderr: `${stderrOutput}
6718
6880
  Process error: ${error.message}`,
@@ -6727,7 +6889,7 @@ Process error: ${error.message}`,
6727
6889
  // src/utils/port.ts
6728
6890
  import { createServer } from "node:net";
6729
6891
  async function getAvailablePort() {
6730
- return new Promise((resolve3, reject) => {
6892
+ return new Promise((resolve, reject) => {
6731
6893
  const server = createServer();
6732
6894
  server.on("error", (err) => {
6733
6895
  reject(new Error(`Failed to get available port: ${err.message}`));
@@ -6745,7 +6907,7 @@ async function getAvailablePort() {
6745
6907
  reject(new Error(`Failed to close server: ${err.message}`));
6746
6908
  return;
6747
6909
  }
6748
- resolve3(port);
6910
+ resolve(port);
6749
6911
  });
6750
6912
  });
6751
6913
  });
@@ -6777,7 +6939,7 @@ class SyncServer {
6777
6939
  this.webSocketOpenState = options.webSocketOpenState ?? import_websocket.default.OPEN;
6778
6940
  }
6779
6941
  async start() {
6780
- return new Promise((resolve3, reject) => {
6942
+ return new Promise((resolve, reject) => {
6781
6943
  try {
6782
6944
  this.httpServer = this.createHttpServer((req, res) => {
6783
6945
  if (req.url === "/sync") {
@@ -6810,7 +6972,7 @@ class SyncServer {
6810
6972
  });
6811
6973
  this.httpServer.on("error", reject);
6812
6974
  this.httpServer.listen(this.port, () => {
6813
- resolve3();
6975
+ resolve();
6814
6976
  });
6815
6977
  } catch (error) {
6816
6978
  reject(error instanceof Error ? error : new Error(String(error)));
@@ -6860,15 +7022,15 @@ class SyncServer {
6860
7022
  }
6861
7023
  this.clients.clear();
6862
7024
  if (this.wss) {
6863
- await new Promise((resolve3) => {
6864
- this.wss.close(() => resolve3());
7025
+ await new Promise((resolve) => {
7026
+ this.wss.close(() => resolve());
6865
7027
  });
6866
7028
  this.wss = null;
6867
7029
  }
6868
7030
  if (this.httpServer) {
6869
- await new Promise((resolve3) => {
7031
+ await new Promise((resolve) => {
6870
7032
  this.httpServer.close(() => {
6871
- resolve3();
7033
+ resolve();
6872
7034
  });
6873
7035
  });
6874
7036
  this.httpServer = null;
@@ -7318,7 +7480,7 @@ function skipVoid(str, ptr, banNewLines, banComments) {
7318
7480
  }
7319
7481
  return ptr;
7320
7482
  }
7321
- function skipUntil(str, ptr, sep2, end, banNewLines = false) {
7483
+ function skipUntil(str, ptr, sep, end, banNewLines = false) {
7322
7484
  if (!end) {
7323
7485
  ptr = indexOfNewline(str, ptr);
7324
7486
  return ptr < 0 ? str.length : ptr;
@@ -7327,7 +7489,7 @@ function skipUntil(str, ptr, sep2, end, banNewLines = false) {
7327
7489
  let c = str[i];
7328
7490
  if (c === "#") {
7329
7491
  i = indexOfNewline(str, i);
7330
- } else if (c === sep2) {
7492
+ } else if (c === sep) {
7331
7493
  return i + 1;
7332
7494
  } else if (c === end || banNewLines && (c === `
7333
7495
  ` || c === "\r" && str[i + 1] === `
@@ -7387,35 +7549,35 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) {
7387
7549
  }
7388
7550
  let c = str[ptr];
7389
7551
  if (c === "[" || c === "{") {
7390
- let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
7552
+ let [value, endPtr] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
7391
7553
  if (end) {
7392
- endPtr2 = skipVoid(str, endPtr2);
7393
- if (str[endPtr2] === ",")
7394
- endPtr2++;
7395
- else if (str[endPtr2] !== end) {
7554
+ endPtr = skipVoid(str, endPtr);
7555
+ if (str[endPtr] === ",")
7556
+ endPtr++;
7557
+ else if (str[endPtr] !== end) {
7396
7558
  throw new TomlError("expected comma or end of structure", {
7397
7559
  toml: str,
7398
- ptr: endPtr2
7560
+ ptr: endPtr
7399
7561
  });
7400
7562
  }
7401
7563
  }
7402
- return [value, endPtr2];
7564
+ return [value, endPtr];
7403
7565
  }
7404
7566
  if (c === '"' || c === "'") {
7405
- let [parsed, endPtr2] = parseString(str, ptr);
7567
+ let [parsed, endPtr] = parseString(str, ptr);
7406
7568
  if (end) {
7407
- endPtr2 = skipVoid(str, endPtr2);
7408
- if (str[endPtr2] && str[endPtr2] !== "," && str[endPtr2] !== end && str[endPtr2] !== `
7409
- ` && str[endPtr2] !== "\r") {
7569
+ endPtr = skipVoid(str, endPtr);
7570
+ if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== `
7571
+ ` && str[endPtr] !== "\r") {
7410
7572
  throw new TomlError("unexpected character encountered", {
7411
7573
  toml: str,
7412
- ptr: endPtr2
7574
+ ptr: endPtr
7413
7575
  });
7414
7576
  }
7415
- if (str[endPtr2] === ",")
7416
- endPtr2++;
7577
+ if (str[endPtr] === ",")
7578
+ endPtr++;
7417
7579
  }
7418
- return [parsed, endPtr2];
7580
+ return [parsed, endPtr];
7419
7581
  }
7420
7582
  let endPtr = skipUntil(str, ptr, ",", end);
7421
7583
  let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === "," ? 1 : 0));
@@ -8016,43 +8178,6 @@ async function cleanupSanitizedBunfig(filePath) {
8016
8178
  }
8017
8179
  }
8018
8180
  }
8019
- // src/utils/test-name-pattern.ts
8020
- var MAX_TEST_NAME_PATTERN_LENGTH = 1e5;
8021
- var fileExtRe = /\.(?:test|spec)\.(?:[jt]sx?|m[jt]s)$/;
8022
- var dedupSuffixRe = / \[\d+\]$/;
8023
- var metaRe = /[.*+?^${}()|[\]\\/]/g;
8024
- function escapeRegex(str) {
8025
- return str.replaceAll(metaRe, String.raw`\$&`);
8026
- }
8027
- function buildTestNamePattern(testFilter, testNameIndex) {
8028
- if (testFilter.length === 0) {
8029
- return;
8030
- }
8031
- const alternatives = new Set;
8032
- for (const id of testFilter) {
8033
- const exact = testNameIndex?.get(id);
8034
- if (exact !== undefined && exact.length > 0 && !exact.includes("\x00")) {
8035
- alternatives.add(escapeRegex(exact));
8036
- continue;
8037
- }
8038
- const firstSepIdx = id.indexOf(" > ");
8039
- let name = firstSepIdx !== -1 && fileExtRe.test(id.slice(0, firstSepIdx)) ? id.slice(firstSepIdx + 3) : id;
8040
- name = name.replace(dedupSuffixRe, "");
8041
- name = name.replaceAll(" > ", " ");
8042
- name = escapeRegex(name);
8043
- if (name.length > 0) {
8044
- alternatives.add(name);
8045
- }
8046
- }
8047
- if (alternatives.size === 0) {
8048
- return;
8049
- }
8050
- const pattern = `^(?:${[...alternatives].join("|")})$`;
8051
- if (Buffer.byteLength(pattern) > MAX_TEST_NAME_PATTERN_LENGTH) {
8052
- return;
8053
- }
8054
- return pattern;
8055
- }
8056
8181
  // src/utils/test-file-discovery.ts
8057
8182
  import * as fsPromises from "node:fs/promises";
8058
8183
  import path3 from "node:path";
@@ -8099,14 +8224,14 @@ async function handleSymlinkFile(fullPath, entryName, ctx) {
8099
8224
  }
8100
8225
  }
8101
8226
  async function handleSymlink(fullPath, entryName, ctx) {
8102
- const stat3 = await tryStat(fullPath);
8103
- if (!stat3) {
8227
+ const stat = await tryStat(fullPath);
8228
+ if (!stat) {
8104
8229
  ctx.logger?.debug("discoverTestFiles: broken symlink at %s; skipping", fullPath);
8105
8230
  return;
8106
8231
  }
8107
- if (stat3.isDirectory()) {
8232
+ if (stat.isDirectory()) {
8108
8233
  await handleSymlinkDir(fullPath, entryName, ctx);
8109
- } else if (stat3.isFile()) {
8234
+ } else if (stat.isFile()) {
8110
8235
  await handleSymlinkFile(fullPath, entryName, ctx);
8111
8236
  }
8112
8237
  }
@@ -8158,8 +8283,8 @@ async function discoverTestFiles(cwd = process.cwd(), logger) {
8158
8283
  }
8159
8284
  // src/bun-test-runner.ts
8160
8285
  function sleep(ms) {
8161
- return new Promise((resolve3) => {
8162
- setTimeout(resolve3, ms);
8286
+ return new Promise((resolve) => {
8287
+ setTimeout(resolve, ms);
8163
8288
  });
8164
8289
  }
8165
8290
  var DRAIN_ACK_SILENCE_TIMEOUT_MS = 4000;
@@ -8178,7 +8303,7 @@ class DrainWaitTimeoutError extends Error {
8178
8303
  function raceAgainstSilence(inspector, silenceMs, absoluteCeilingMs, message) {
8179
8304
  const startedAt = Date.now();
8180
8305
  let timer;
8181
- const promise2 = new Promise((_resolve, reject) => {
8306
+ const promise = new Promise((_resolve, reject) => {
8182
8307
  timer = setInterval(() => {
8183
8308
  const sinceLastFrame = inspector.getMsSinceLastFrame();
8184
8309
  const totalElapsed = Date.now() - startedAt;
@@ -8191,7 +8316,7 @@ function raceAgainstSilence(inspector, silenceMs, absoluteCeilingMs, message) {
8191
8316
  }
8192
8317
  }, DRAIN_SILENCE_POLL_INTERVAL_MS);
8193
8318
  });
8194
- return { promise: promise2, cancel: () => clearInterval(timer) };
8319
+ return { promise, cancel: () => clearInterval(timer) };
8195
8320
  }
8196
8321
  function formatGapIdList(gaps) {
8197
8322
  if (gaps.length === 0) {
@@ -8219,6 +8344,7 @@ var MAX_COVERAGE_BLEED_WARNINGS = 25;
8219
8344
  var EXECUTION_SHORTFALL_ABS_FLOOR = 10;
8220
8345
  var EXECUTION_SHORTFALL_RATIO_THRESHOLD = 0.05;
8221
8346
  var ORPHANED_KEY_ABS_FLOOR = 5;
8347
+ var TEST_ID_FILE_SEPARATOR = " > ";
8222
8348
  var INSPECTOR_DRAIN_TIMEOUT_MS = 1000;
8223
8349
 
8224
8350
  class BunTestRunner {
@@ -8234,6 +8360,7 @@ class BunTestRunner {
8234
8360
  smol;
8235
8361
  maxChildRss;
8236
8362
  rssCheckIntervalMs;
8363
+ maxSpawnDepth;
8237
8364
  preloadScriptPath;
8238
8365
  coverageFilePath;
8239
8366
  sanitizedBunfigPath;
@@ -8259,6 +8386,7 @@ class BunTestRunner {
8259
8386
  this.smol = bunOptions.smol ?? false;
8260
8387
  this.maxChildRss = bunOptions.maxChildRss;
8261
8388
  this.rssCheckIntervalMs = bunOptions.rssCheckIntervalMs;
8389
+ this.maxSpawnDepth = bunOptions.maxSpawnDepth;
8262
8390
  if (bunOptions.testFiles?.length === 0) {
8263
8391
  this.logger.warn("bun.testFiles was set to an empty array — treating as undefined and falling back to auto-discovery");
8264
8392
  this.testFilesOverride = undefined;
@@ -8274,7 +8402,8 @@ class BunTestRunner {
8274
8402
  bunArgs: this.bunArgs,
8275
8403
  smol: this.smol,
8276
8404
  maxChildRss: this.maxChildRss,
8277
- rssCheckIntervalMs: this.rssCheckIntervalMs
8405
+ rssCheckIntervalMs: this.rssCheckIntervalMs,
8406
+ maxSpawnDepth: this.maxSpawnDepth
8278
8407
  });
8279
8408
  if (this.testFilesOverride?.some((p) => path4.isAbsolute(p))) {
8280
8409
  const isSandbox = process.cwd().includes(".stryker-tmp/sandbox-");
@@ -8291,6 +8420,29 @@ class BunTestRunner {
8291
8420
  get registryTmpPath() {
8292
8421
  return `${this.registryPath}.tmp`;
8293
8422
  }
8423
+ resolveCoveringTestFiles(filterIds) {
8424
+ if (filterIds.length === 0) {
8425
+ return;
8426
+ }
8427
+ const discovered = this.cachedTestFiles;
8428
+ if (!discovered || discovered.length === 0) {
8429
+ return;
8430
+ }
8431
+ const discoveredSet = new Set(discovered);
8432
+ const files = new Set;
8433
+ for (const id of filterIds) {
8434
+ const sepIdx = id.indexOf(TEST_ID_FILE_SEPARATOR);
8435
+ if (sepIdx === -1) {
8436
+ return;
8437
+ }
8438
+ const file = id.slice(0, sepIdx);
8439
+ if (!discoveredSet.has(file)) {
8440
+ return;
8441
+ }
8442
+ files.add(file);
8443
+ }
8444
+ return [...files].toSorted((a, b) => a.localeCompare(b));
8445
+ }
8294
8446
  capabilities() {
8295
8447
  return {
8296
8448
  reloadEnvironment: true
@@ -8553,6 +8705,7 @@ ${stack}` : baseFailureMessage;
8553
8705
  smol: this.smol,
8554
8706
  maxChildRss: this.maxChildRss,
8555
8707
  rssCheckIntervalMs: this.rssCheckIntervalMs,
8708
+ maxSpawnDepth: this.maxSpawnDepth,
8556
8709
  onMemoryLimitExceeded: (rssBytes) => {
8557
8710
  this.logger.warn("bun test child exceeded maxChildRss (%d bytes observed) during dryRun — killing and reporting as a timeout for this run", rssBytes);
8558
8711
  },
@@ -8670,7 +8823,7 @@ exit=%s timedOut=%s
8670
8823
  const { coverage: mutantCoverage, inspectorIdToProjectFile, rawKeyCount, orphanedKeyCount } = await this.collectAndRemapCoverage(testHierarchy, executionOrder);
8671
8824
  const { tests, testNameIndex } = this.buildTestsFromInspector(testHierarchy, executionOrder, parsed, totalElapsedMs, inspectorIdToProjectFile);
8672
8825
  tests.sort((a, b) => a.name.localeCompare(b.name));
8673
- const gateResult = this.checkCompletenessGate(executionOrder, testHierarchy, parsed, rawKeyCount, orphanedKeyCount, wasClosedUnexpectedly, tests, closeInfo);
8826
+ const gateResult = this.checkCompletenessGate(executionOrder, testHierarchy, parsed, rawKeyCount, orphanedKeyCount, wasClosedUnexpectedly, tests, closeInfo, result.stderr);
8674
8827
  if (gateResult) {
8675
8828
  return gateResult;
8676
8829
  }
@@ -8754,9 +8907,9 @@ exit=%s timedOut=%s
8754
8907
  const mutantCwd = process.cwd();
8755
8908
  const bunfigPath = this.sanitizedBunfigPath && this.sanitizedBunfigCwd === mutantCwd ? this.sanitizedBunfigPath : await this.ensureSanitizedBunfig();
8756
8909
  this.cachedTestFiles = await this.getOrDiscoverTestFiles();
8757
- return this.executeMutantRun(options, bunfigPath, testNamePattern, localRegistry, localBaseIndex);
8910
+ return this.executeMutantRun(options, bunfigPath, testNamePattern, localRegistry, localBaseIndex, this.resolveCoveringTestFiles(filterIds));
8758
8911
  }
8759
- async executeMutantRun(options, bunfigPath, testNamePattern, localRegistry, localBaseIndex) {
8912
+ async executeMutantRun(options, bunfigPath, testNamePattern, localRegistry, localBaseIndex, coveringTestFiles) {
8760
8913
  const abortController = new AbortController;
8761
8914
  this.currentAbortController = abortController;
8762
8915
  let result;
@@ -8772,11 +8925,12 @@ exit=%s timedOut=%s
8772
8925
  sequentialMode: true,
8773
8926
  preloadScript: this.preloadScriptPath,
8774
8927
  testNamePattern,
8775
- testFiles: this.cachedTestFiles,
8928
+ testFiles: testNamePattern === undefined ? this.cachedTestFiles : coveringTestFiles ?? this.cachedTestFiles,
8776
8929
  signal: abortController.signal,
8777
8930
  smol: this.smol,
8778
8931
  maxChildRss: this.maxChildRss,
8779
8932
  rssCheckIntervalMs: this.rssCheckIntervalMs,
8933
+ maxSpawnDepth: this.maxSpawnDepth,
8780
8934
  onMemoryLimitExceeded: (rssBytes) => {
8781
8935
  this.logger.warn("bun test child exceeded maxChildRss (%d bytes observed) during mutant run %s — killing and reporting as a timeout for this mutant", rssBytes, options.activeMutant.id);
8782
8936
  }
@@ -8821,13 +8975,12 @@ exit=%s timedOut=%s
8821
8975
  }
8822
8976
  const killedBy = this.resolveKilledBy(rawFailedNames, localRegistry, localBaseIndex, mutantId);
8823
8977
  if (killedBy.length === 0) {
8824
- this.logger.warn("No failed tests identified for mutant %s — Bun output could not be parsed; " + `using "unknown" fallback (breaks incremental cache)
8978
+ this.logger.warn("Mutant %s: no killing test identifiable — emitting empty killedBy; " + `this mutant will re-run on every incremental run
8825
8979
  ` + `exit=%s
8826
8980
  --- STDOUT (first 600 chars) ---
8827
8981
  %s
8828
8982
  ` + `--- STDERR (first 600 chars) ---
8829
8983
  %s`, mutantId, String(result.exitCode), result.stdout.slice(0, 600) || "(empty)", result.stderr.slice(0, 600) || "(empty)");
8830
- killedBy.push("unknown");
8831
8984
  }
8832
8985
  return {
8833
8986
  status: MutantRunStatus.Killed,
@@ -8909,7 +9062,7 @@ ${lines.join(`
8909
9062
  %s`, String(result.exitCode), parsed.failed, result.stderr.slice(-500));
8910
9063
  }
8911
9064
  }
8912
- checkCompletenessGate(executionOrder, testHierarchy, parsed, rawKeyCount, orphanedKeyCount, wasClosedUnexpectedly, tests, closeInfo) {
9065
+ checkCompletenessGate(executionOrder, testHierarchy, parsed, rawKeyCount, orphanedKeyCount, wasClosedUnexpectedly, tests, closeInfo, stderr) {
8913
9066
  if (tests.some((t) => t.status === TestStatus.Failed)) {
8914
9067
  return null;
8915
9068
  }
@@ -8922,7 +9075,8 @@ ${lines.join(`
8922
9075
  const shortfall = consoleTotal - nonSkippedExecutionCount;
8923
9076
  const signalA = consoleTotal > 0 && shortfall > EXECUTION_SHORTFALL_ABS_FLOOR && shortfall / consoleTotal > EXECUTION_SHORTFALL_RATIO_THRESHOLD;
8924
9077
  const signalB = orphanedKeyCount > ORPHANED_KEY_ABS_FLOOR;
8925
- if (!signalA && !signalB) {
9078
+ const signalC = parsed.summaryFailed > 0;
9079
+ if (!signalA && !signalB && !signalC) {
8926
9080
  return null;
8927
9081
  }
8928
9082
  const reasons = [];
@@ -8932,6 +9086,10 @@ ${lines.join(`
8932
9086
  if (signalB) {
8933
9087
  reasons.push(`${orphanedKeyCount} of ${rawKeyCount} coverage key(s) could not be paired with any inspector test (orphaned)`);
8934
9088
  }
9089
+ if (signalC) {
9090
+ reasons.push(`bun's console summary reported ${parsed.summaryFailed} failing test(s), but none of them could be ` + "attributed to an individual test — a whole spec file that fails to load (e.g. an unresolvable " + `import) produces exactly this shape. Last 500 chars of stderr:
9091
+ ${stderr.slice(-500)}`);
9092
+ }
8935
9093
  if (wasClosedUnexpectedly) {
8936
9094
  const closeDetail = closeInfo.code === undefined ? "close code/reason not captured" : `close code=${closeInfo.code} reason=${JSON.stringify(closeInfo.reason ?? "")} wasClean=${String(closeInfo.wasClean)}, ${String(closeInfo.msFromLastFrameToClose)}ms after the last received frame`;
8937
9095
  reasons.push(`the inspector WebSocket closed unexpectedly before this data could be fully drained (${closeDetail})`);
@@ -8993,6 +9151,7 @@ ${lines.join(`
8993
9151
  }
8994
9152
  resolveKilledBy(rawFailedNames, localRegistry, localBaseIndex, mutantId) {
8995
9153
  const killedBySet = new Set;
9154
+ const unresolved = new Set;
8996
9155
  for (const name of rawFailedNames) {
8997
9156
  if (localRegistry.has(name)) {
8998
9157
  killedBySet.add(name);
@@ -9018,11 +9177,18 @@ ${lines.join(`
9018
9177
  }
9019
9178
  continue;
9020
9179
  }
9021
- this.logger.debug('killedBy name "%s" for mutant %s not found in test registry; including as-is', name, mutantId);
9022
- killedBySet.add(name);
9180
+ unresolved.add(name);
9023
9181
  }
9182
+ this.warnUnresolvedKilledBy(unresolved, mutantId);
9024
9183
  return [...killedBySet];
9025
9184
  }
9185
+ warnUnresolvedKilledBy(unresolved, mutantId) {
9186
+ if (unresolved.size === 0) {
9187
+ return;
9188
+ }
9189
+ const sample = [...unresolved];
9190
+ this.logger.warn("Mutant %s: %d failed test name(s) could not be resolved to dry-run test ids and will not be recorded in killedBy — this mutant's Killed verdict will not be reusable from the incremental cache: %s%s", mutantId, unresolved.size, sample.slice(0, 5).join(", "), sample.length > 5 ? ", …" : "");
9191
+ }
9026
9192
  async dispose() {
9027
9193
  this.logger.debug("Disposing BunTestRunner");
9028
9194
  if (this.currentAbortController) {
@@ -9120,6 +9286,12 @@ var strykerValidationSchema = {
9120
9286
  minimum: 0,
9121
9287
  description: "Poll interval in milliseconds for the maxChildRss check (default: 1000).",
9122
9288
  default: 1000
9289
+ },
9290
+ maxSpawnDepth: {
9291
+ type: "integer",
9292
+ minimum: 1,
9293
+ description: "Maximum `bun test` spawn nesting depth before the runner refuses to spawn (default: 1). Guards against runaway recursion when a run spawned by this runner ends up spawning another one. Raise to 2 only if your own tests drive this runner.",
9294
+ default: 1
9123
9295
  }
9124
9296
  },
9125
9297
  additionalProperties: false
@@ -9127,7 +9299,7 @@ var strykerValidationSchema = {
9127
9299
  }
9128
9300
  };
9129
9301
  export {
9130
- strykerValidationSchema,
9302
+ BunTestRunner,
9131
9303
  strykerPlugins,
9132
- BunTestRunner
9304
+ strykerValidationSchema
9133
9305
  };