@hughescr/stryker-bun-runner 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +7 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3210,8 +3210,8 @@ function buildBlock(printed, headerFile) {
3210
3210
  lateCall: errorLine === undefined ? undefined : LATE_CALL_RE.exec(errorLine)?.[1]
3211
3211
  };
3212
3212
  }
3213
- function blockSpans(stderr, secrets) {
3214
- const lines = cleanDiagnosticText(stderr, secrets).split(/\r?\n/).map((line) => line.trimEnd());
3213
+ function blockSpans(text) {
3214
+ const lines = text.split(/\r?\n/).map((line) => line.trimEnd());
3215
3215
  const starts = lines.flatMap((line, i) => line === BLOCK_MARKER && lines[i + 1] === BLOCK_RULE ? [i] : []);
3216
3216
  const spans = [];
3217
3217
  let scanned = 0;
@@ -3225,15 +3225,15 @@ function blockSpans(stderr, secrets) {
3225
3225
  }
3226
3226
  function parseUnhandledErrorBlocks(stderr, secrets = []) {
3227
3227
  let headerFile;
3228
- return blockSpans(stderr, secrets).map(({ before, body }) => {
3228
+ return blockSpans(cleanDiagnosticText(stderr, secrets)).map(({ before, body }) => {
3229
3229
  for (const line of before) {
3230
3230
  headerFile = FILE_HEADER_RE.exec(line)?.[1] ?? headerFile;
3231
3231
  }
3232
3232
  return buildBlock(body, headerFile);
3233
3233
  });
3234
3234
  }
3235
- function blockHeaderFiles(stderr, runFileOf, secrets = []) {
3236
- return blockSpans(stderr, secrets).map(({ before }) => {
3235
+ function blockHeaderFiles(stderr, runFileOf) {
3236
+ return blockSpans(stripAnsiForDiagnostics(stderr)).map(({ before }) => {
3237
3237
  const printed = before.filter((line) => line !== "");
3238
3238
  const last = printed.at(-1);
3239
3239
  const file = last === undefined ? undefined : runFileOf(last);
@@ -3537,9 +3537,6 @@ function dryRunKey(file, cwd) {
3537
3537
  }
3538
3538
  function noTestRan(output, blockCount) {
3539
3539
  const summary = readBunSummary(output);
3540
- if (summary.ran === undefined) {
3541
- return false;
3542
- }
3543
3540
  if (summary.bailed !== undefined) {
3544
3541
  return summary.ran === summary.bailed;
3545
3542
  }
@@ -3548,11 +3545,11 @@ function noTestRan(output, blockCount) {
3548
3545
  var NO_CREDIT = { killedBy: [], files: [] };
3549
3546
  function creditLoadFailures(run) {
3550
3547
  const { byFile, testFiles, cwd, covering } = run;
3551
- if (byFile === undefined || testFiles === undefined || testFiles.length === 0) {
3548
+ if (byFile === undefined || testFiles === undefined) {
3552
3549
  return NO_CREDIT;
3553
3550
  }
3554
3551
  const headers = blockHeaderFiles(run.stderr, runFileResolver(testFiles, cwd));
3555
- if (headers.length === 0 || !noTestRan(`${run.stdout}
3552
+ if (!noTestRan(`${run.stdout}
3556
3553
  ${run.stderr}`, headers.length)) {
3557
3554
  return NO_CREDIT;
3558
3555
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hughescr/stryker-bun-runner",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Stryker mutation testing test runner plugin for Bun (bun test), with per-test coverage",
5
5
  "keywords": [
6
6
  "stryker",