supercov 4.29.3 → 4.29.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.
- package/docs/cli.md +5 -0
- package/docs/mutation.md +14 -0
- package/package.json +9 -9
- package/runtime/javascript/playwright.mjs +11 -1
- package/runtime/javascript/playwrightStrong.mjs +872 -303
- package/runtime/javascript/playwrightStrongReporter.mjs +328 -299
- package/runtime/javascript/runtime.mjs +25 -0
|
@@ -2888,6 +2888,31 @@ function strongHit() {
|
|
|
2888
2888
|
noteMutantTimeout(strong.file, strong.index);
|
|
2889
2889
|
throw new MutantTimeoutError(strong.file, strong.index, strong.hits);
|
|
2890
2890
|
}
|
|
2891
|
+
if (strong.hits === 1)
|
|
2892
|
+
noteEverywhereHit(strong);
|
|
2893
|
+
}
|
|
2894
|
+
// A process started with a mutant switched on everywhere, in a round where
|
|
2895
|
+
// each Playwright invocation runs one mutant of its own (its runner set
|
|
2896
|
+
// SUPERCOV_ACTIVE_MUTANT for the processes it starts, the app's server among
|
|
2897
|
+
// them): the mutant ran here, in a process that is neither the runner nor
|
|
2898
|
+
// one of its workers. The round trusts a survivor only where its own server
|
|
2899
|
+
// ran it.
|
|
2900
|
+
function noteEverywhereHit(strong) {
|
|
2901
|
+
try {
|
|
2902
|
+
if (isBrowser || typeof process === "undefined" || !process.env)
|
|
2903
|
+
return;
|
|
2904
|
+
const env = process.env;
|
|
2905
|
+
const invocation = env["SUPERCOV_PLAYWRIGHT_INVOCATION"];
|
|
2906
|
+
const results = env["SUPERCOV_STRONG_RESULTS"];
|
|
2907
|
+
if (!invocation || !results || env["TEST_WORKER_INDEX"] !== void 0 || String(process.pid) === invocation)
|
|
2908
|
+
return;
|
|
2909
|
+
if (env["SUPERCOV_ACTIVE_MUTANT"] !== `${strong.file}#${strong.index}`)
|
|
2910
|
+
return;
|
|
2911
|
+
const fs = getFs();
|
|
2912
|
+
if (fs)
|
|
2913
|
+
fs.appendFileSync(`${results}.everywhere.jsonl`, JSON.stringify({ pid: process.pid, invocation, mutant: env["SUPERCOV_ACTIVE_MUTANT"] }) + "\n");
|
|
2914
|
+
} catch (e) {
|
|
2915
|
+
}
|
|
2891
2916
|
}
|
|
2892
2917
|
function strongSlot(file) {
|
|
2893
2918
|
const strong = strongState();
|