supercov 4.24.3 → 4.24.5

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.
@@ -65,7 +65,8 @@ one run and preserves runner identity wherever the runner exposes it.
65
65
  ### Bun
66
66
 
67
67
  Run `supercov -- bun test` or the package script that launches it. Supercov
68
- loads a native Bun adapter through `BUN_OPTIONS`, preserving existing Bun
68
+ loads a native Bun adapter before configured preloads in the isolated copy,
69
+ and through `BUN_OPTIONS` for commands without them, preserving existing Bun
69
70
  options, configured preloads, and the project's files. Named ESM imports,
70
71
  namespace imports, and CommonJS `require('bun:test')` are supported. Bun ignores
71
72
  Node's preload settings, so the Node adapter alone cannot attribute its tests.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supercov",
3
- "version": "4.24.3",
3
+ "version": "4.24.5",
4
4
  "description": "Coverage, security and code quality for coding agents",
5
5
  "keywords": [
6
6
  "coverage",
@@ -123,14 +123,14 @@
123
123
  "test:windows-tls": "node scripts/windows-tls-test.mjs"
124
124
  },
125
125
  "optionalDependencies": {
126
- "@supercov/cli-darwin-arm64": "4.24.3",
127
- "@supercov/cli-darwin-x64": "4.24.3",
128
- "@supercov/cli-linux-arm64-gnu": "4.24.3",
129
- "@supercov/cli-linux-arm64-musl": "4.24.3",
130
- "@supercov/cli-linux-x64-gnu": "4.24.3",
131
- "@supercov/cli-linux-x64-musl": "4.24.3",
132
- "@supercov/cli-win32-arm64": "4.24.3",
133
- "@supercov/cli-win32-x64": "4.24.3"
126
+ "@supercov/cli-darwin-arm64": "4.24.5",
127
+ "@supercov/cli-darwin-x64": "4.24.5",
128
+ "@supercov/cli-linux-arm64-gnu": "4.24.5",
129
+ "@supercov/cli-linux-arm64-musl": "4.24.5",
130
+ "@supercov/cli-linux-x64-gnu": "4.24.5",
131
+ "@supercov/cli-linux-x64-musl": "4.24.5",
132
+ "@supercov/cli-win32-arm64": "4.24.5",
133
+ "@supercov/cli-win32-x64": "4.24.5"
134
134
  },
135
135
  "peerDependencies": {
136
136
  "@playwright/test": ">=1.55.0",
@@ -1,5 +1,6 @@
1
- // Bun does not load the Node --import preload. BUN_OPTIONS loads this before
2
- // its test files and their configured preloads. Older Bun versions create a
1
+ // Bun does not load the Node --import preload. The isolated configuration
2
+ // loads this before configured preloads; BUN_OPTIONS covers other commands.
3
+ // Older Bun versions create a
3
4
  // native API per file; newer versions share one. Adapt the factory and the
4
5
  // existing API so both keep native test registration and execution semantics.
5
6
  import * as runtime from "./runtime.mjs";
@@ -314,7 +314,7 @@ function wrapResult(value, mapping) {
314
314
  // non-writable own data property (and `undefined` for a non-configurable
315
315
  // accessor without a getter). Constructors commonly expose `prototype` this
316
316
  // way. Returning another capability proxy is a TypeError before user code can
317
- // run, as seen with PrismaSessionStorage during an Essential Apps VM bake.
317
+ // run, as seen with PrismaSessionStorage during a VM bake.
318
318
  function fixedProxyValue(target, property) {
319
319
  const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
320
320
  if (!descriptor || descriptor.configurable)
@@ -734,14 +734,24 @@ function injectChildEnvironment(method, args) {
734
734
  // right after it listened read as one that never became ready, and a
735
735
  // Playwright worker as one that "exited unexpectedly".
736
736
  const CRASH_SIGNALS = new Set(["SIGSEGV", "SIGBUS", "SIGILL", "SIGFPE", "SIGABRT", "SIGTRAP", "SIGSYS"]);
737
- function noteCrash(signal, child, command, started) {
738
- if (!CRASH_SIGNALS.has(signal))
737
+ // The command a child ran, its arguments too: `spawn("npm", ["run",
738
+ // "build"])` names its build only with them.
739
+ function commandLine(args) {
740
+ const words = Array.isArray(args[1]) ? args[1] : [];
741
+ return [args[0], ...words].map((word) => String(word ?? "")).join(" ");
742
+ }
743
+ // A child that a crash signal ended, or that exited non-zero: a build the
744
+ // command started from its own code, which the command's words do not
745
+ // name, is told apart from one it never ran by this.
746
+ function noteExit(signal, code, child, args, started) {
747
+ const crashed = CRASH_SIGNALS.has(signal);
748
+ if (!crashed && !(signal == null && typeof code === "number" && code !== 0))
739
749
  return;
740
750
  record({
741
751
  event: "child-exit",
742
752
  ...(typeof child === "number" ? { child } : {}),
743
- signal,
744
- command: safeArgument(String(command ?? "")),
753
+ ...(crashed ? { signal } : { code }),
754
+ command: safeArgument(commandLine(args)),
745
755
  ranMs: Date.now() - started,
746
756
  });
747
757
  }
@@ -752,14 +762,14 @@ function watchChild(method, args, run) {
752
762
  launched = run();
753
763
  }
754
764
  catch (error) {
755
- // execSync and execFileSync throw for a child a signal ended.
756
- noteCrash(error?.signal, error?.pid, args[0], started);
765
+ // execSync and execFileSync throw for a child that failed.
766
+ noteExit(error?.signal, error?.status, error?.pid, args, started);
757
767
  throw error;
758
768
  }
759
769
  if (method === "spawnSync")
760
- noteCrash(launched?.signal, launched?.pid, args[0], started);
770
+ noteExit(launched?.signal, launched?.status, launched?.pid, args, started);
761
771
  else if (typeof launched?.once === "function")
762
- launched.once("exit", (_code, signal) => noteCrash(signal, launched.pid, args[0], started));
772
+ launched.once("exit", (code, signal) => noteExit(signal, code, launched.pid, args, started));
763
773
  return launched;
764
774
  }
765
775
  function patchChildProcesses() {