fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on Windows

Offen Anfängerfreundlich
#2,514 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@easonLiangWorldedtech arbeitet bereits daran.

Seit 13.11.2026.

  • #2450 von @easonLiangWorldedtech — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript
Bereich
devtools, testing-qa

Rechercherichtung

Lies scripts/stryker-diff.mjs um Zeile 412 herum und prüfe, wie das Skript die Stryker-Binärdatei startet. Prüfe die Einträge in node_modules/.bin des Pakets und vergleiche, wie das Skript Windows und POSIX behandelt. Das Ziel ist erreicht, wenn der lokale Mutation-Preflight Stryker unter Windows starten kann und weiterhin unter Linux funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Symptom

node scripts/stryker-diff.mjs cannot start Stryker on Windows: spawnSync ... ENOENT for node_modules\.bin\stryker, even though the file exists and stryker --version reports 10.0.0. The local preflight described in the mutation-gate protocol therefore only works on Linux, and every Windows contributor has to fall back to CI for the changed-line mutation report.

Cause

scripts/stryker-diff.mjs:421 passes the extensionless POSIX shim straight to spawnSync - no shell, no process.platform branch - and the sibling call at line 373 does the same for vitest. The installed set is stryker, stryker.CMD, stryker.ps1 (measured at main 410e5ad3d5, blob 7dfe0006d2d5, unchanged since a15ba8c8); only the latter two are runnable.

Expected

Do not branch on the suffix: spawning node_modules\.bin\stryker.CMD without a shell was probed and returns EINVAL (-4071), where the extensionless shim returns ENOENT (-4058). Resolve the entry the owning package declares - @stryker-mutator/core ships bin: {"stryker": "./bin/stryker.js"} - and run that file through process.execPath: status 0 with 10.0.0 in 1000 ms; vitest's declared vitest.mjs starts in 64 ms the same way. #2450 implements exactly that for both calls.

Workaround meanwhile

Run the gate's Stryker step through cmd /c node_modules\.bin\stryker.CMD with the six STRYKER_* variables the script already sets, and keep reading the CI mutation-diff run as the authority.

Vorherrschende Sprache
TypeScript
Sterne
2k
Forks
301
Ø Merge
3 T. 14 Std.
Gemergte PRs (30 T.)
103

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Zoo-Code-Org/Zoo-Code

Alle Issues in Zoo-Code-Org/Zoo-Code

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.