@systemfsoftware/stryker-js-cli 8.0.0 → 9.0.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/CHANGELOG.md +42 -0
- package/README.md +22 -22
- package/dist/compiler-Bq9Nelu8.mjs +48406 -0
- package/dist/{dist-Bn6hT7sW.mjs → dist-B3nT7z4G.mjs} +115 -16
- package/dist/execAsync-CfPZgJSD.mjs +10 -0
- package/dist/execAsync-DdCu5QLN.mjs +10 -0
- package/dist/getMachineId-bsd-C6bLIaiv.mjs +27 -0
- package/dist/getMachineId-bsd-CXSiHDga.mjs +27 -0
- package/dist/getMachineId-darwin-D3cIKeqx.mjs +24 -0
- package/dist/getMachineId-darwin-DPZ0kdKD.mjs +24 -0
- package/dist/getMachineId-linux-CQwLSlZk.mjs +20 -0
- package/dist/getMachineId-linux-Ci8OVJU0.mjs +20 -0
- package/dist/getMachineId-unsupported-PX0hnW6X.mjs +15 -0
- package/dist/getMachineId-unsupported-_ExL3Avl.mjs +15 -0
- package/dist/getMachineId-win-BCsS9pC_.mjs +26 -0
- package/dist/getMachineId-win-D9Tb0p7w.mjs +26 -0
- package/dist/main.mjs +95953 -1371
- package/dist/{wasm-CmiFEbUB.mjs → wasm-Dr7kZatW.mjs} +40 -18
- package/package.json +30 -35
- package/dist/Reporter-Bx0LTTkQ.mjs +0 -31690
- package/dist/compiler-CyKSVP2x.mjs +0 -27429
- package/dist/esm-shims-z34yX56b.mjs +0 -12
- package/dist/node-7-yHBdZ2.mjs +0 -27485
- package/dist/reporters/html.mjs +0 -77
- package/dist/worker-runtime-CU41J_c_.mjs +0 -697
- package/dist/workers/checker-worker.mjs +0 -42
- package/dist/workers/child-process-test-runner-worker.mjs +0 -65
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Ar as fail, Cs as match, Dr as die, Mr as flatMap, Pr as forEach, Vr as gen, ei as map, fa as mergeAll, fi as provide, g as SandboxDirectory, h as RunConfiguration, ha as succeed, ki as succeed$1, nn as Path, on as FileSystem, pa as provide$1 } from "../Reporter-Bx0LTTkQ.mjs";
|
|
2
|
-
import { H as CheckerFailed, I as loadPlugins, N as create, P as decodeWorkerOptions, V as Checker, X as layerNdjson, i as layer, k as CheckerRpcs, r as layer$1, t as nodeModuleLayer, vt as fromIterable, yt as get } from "../node-7-yHBdZ2.mjs";
|
|
3
|
-
import { a as layerProtocolSocketServer, i as layer$2, n as workerSocketPath, r as layer$3, t as launchWorker } from "../worker-runtime-CU41J_c_.mjs";
|
|
4
|
-
//#region src/workers/Checker.worker.ts
|
|
5
|
-
const buildChecker = (contribution, options) => Checker.pipe(provide(contribution.layer.pipe(provide$1(mergeAll(succeed(RunConfiguration, options), succeed(SandboxDirectory, process.cwd()), layer, layer$1, nodeModuleLayer)))));
|
|
6
|
-
const mutantIdsOf = (mutants) => mutants.map((mutant) => mutant.id);
|
|
7
|
-
const readWorkerOptions = gen(function* () {
|
|
8
|
-
const workerDir = process.env["STRYKER_WORKER_DIR"] ?? (yield* die(/* @__PURE__ */ new Error("STRYKER_WORKER_DIR is not set")));
|
|
9
|
-
const fs = yield* FileSystem;
|
|
10
|
-
const path = yield* Path;
|
|
11
|
-
const raw = yield* fs.readFileString(path.join(workerDir, "options.json"));
|
|
12
|
-
return yield* decodeWorkerOptions(raw);
|
|
13
|
-
});
|
|
14
|
-
const CheckerHandlers = CheckerRpcs.toLayer(gen(function* () {
|
|
15
|
-
const options = yield* readWorkerOptions;
|
|
16
|
-
const loaded = yield* loadPlugins(options.plugins, process.cwd());
|
|
17
|
-
const checkers = fromIterable(yield* forEach(options.checkers, (name) => gen(function* () {
|
|
18
|
-
const contribution = yield* create(loaded.pluginsByKind, "Checker", name);
|
|
19
|
-
const checker = yield* buildChecker(contribution, options);
|
|
20
|
-
yield* checker.init;
|
|
21
|
-
return [name, checker];
|
|
22
|
-
}), {
|
|
23
|
-
concurrency: "unbounded",
|
|
24
|
-
discard: false
|
|
25
|
-
}));
|
|
26
|
-
const resolve = (checkerName, mutants) => match(get(checkers, checkerName), {
|
|
27
|
-
onNone: () => fail(new CheckerFailed({
|
|
28
|
-
cause: `Checker ${checkerName} does not exist`,
|
|
29
|
-
checkerName,
|
|
30
|
-
mutantIds: mutantIdsOf(mutants)
|
|
31
|
-
})),
|
|
32
|
-
onSome: (checker) => succeed$1(checker)
|
|
33
|
-
});
|
|
34
|
-
return {
|
|
35
|
-
check: ({ checkerName, mutants }) => resolve(checkerName, mutants).pipe(flatMap((checker) => checker.check([...mutants])), map((resultMap) => Object.fromEntries(resultMap))),
|
|
36
|
-
group: ({ checkerName, mutants }) => resolve(checkerName, mutants).pipe(flatMap((checker) => checker.group([...mutants])))
|
|
37
|
-
};
|
|
38
|
-
})).pipe(provide$1(mergeAll(layer, layer$1)));
|
|
39
|
-
const MainLayer = layer$2(CheckerRpcs).pipe(provide$1(CheckerHandlers), provide$1(layerProtocolSocketServer), provide$1(layerNdjson), provide$1(layer$3({ path: workerSocketPath("checker worker") })), provide$1(nodeModuleLayer));
|
|
40
|
-
launchWorker(MainLayer, "checker worker");
|
|
41
|
-
//#endregion
|
|
42
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Ar as fail, Cs as match, Dr as die, Hr as ignore, Mr as flatMap, Ot as optional, Ss as map, Vr as gen, Vt as exhaustive, Xt as value, Zt as when, _r as catchCause, cs as exists, da as merge, dt as decodeUnknownEffect, ei as map$1, fa as mergeAll, fi as provide, g as SandboxDirectory, h as RunConfiguration, ha as succeed$1, ki as succeed, ms as getOrElse, nn as Path, on as FileSystem, pa as provide$1, ps as fromUndefinedOr, to as pretty, ui as orElseSucceed, ur as addFinalizer, w as TestRunnerFailed, xs as liftPredicate } from "../Reporter-Bx0LTTkQ.mjs";
|
|
2
|
-
import { B as errorToString, I as loadPlugins, M as TestRunnerRpcs, N as create, P as decodeWorkerOptions, R as TestRunner, X as layerNdjson, i as layer, j as MutantCoverageSchema, r as layer$1, t as nodeModuleLayer } from "../node-7-yHBdZ2.mjs";
|
|
3
|
-
import { a as layerProtocolSocketServer, i as layer$2, n as workerSocketPath, r as layer$3, t as launchWorker } from "../worker-runtime-CU41J_c_.mjs";
|
|
4
|
-
//#region src/workers/child-process-test-runner-worker.ts
|
|
5
|
-
const isCompleteDryRun = (result) => result.status === "complete";
|
|
6
|
-
const COVERAGE_SETTLED = [
|
|
7
|
-
(result) => result.status !== "complete",
|
|
8
|
-
(result) => exists(liftPredicate(result, isCompleteDryRun), (complete) => complete.mutantCoverage !== void 0),
|
|
9
|
-
(_result, options) => options.coverageAnalysis === "off"
|
|
10
|
-
];
|
|
11
|
-
const coverageNeeded = (result, options) => !COVERAGE_SETTLED.some((settled) => settled(result, options));
|
|
12
|
-
const normalizeDryRun = (result) => {
|
|
13
|
-
if (result.status === "error") return {
|
|
14
|
-
...result,
|
|
15
|
-
errorMessage: errorToString(result.errorMessage)
|
|
16
|
-
};
|
|
17
|
-
return result;
|
|
18
|
-
};
|
|
19
|
-
const decodeCoverageInto = (result) => gen(function* () {
|
|
20
|
-
const decoded = yield* decodeUnknownEffect(optional(MutantCoverageSchema))(globalThis.__mutantCoverage__).pipe(orElseSucceed(() => void 0));
|
|
21
|
-
return match(liftPredicate(result, isCompleteDryRun), {
|
|
22
|
-
onNone: () => normalizeDryRun(result),
|
|
23
|
-
onSome: (complete) => getOrElse(map(fromUndefinedOr(decoded), (coverage) => ({
|
|
24
|
-
...complete,
|
|
25
|
-
mutantCoverage: coverage
|
|
26
|
-
})), () => complete)
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
const withCoverage = (result, options) => value(coverageNeeded(result, options)).pipe(when(true, () => decodeCoverageInto(result)), when(false, () => succeed(normalizeDryRun(result))), exhaustive);
|
|
30
|
-
const normalizeMutantRun = (result) => {
|
|
31
|
-
if (result.status === "error") return {
|
|
32
|
-
...result,
|
|
33
|
-
errorMessage: errorToString(result.errorMessage)
|
|
34
|
-
};
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
const readWorkerOptions = gen(function* () {
|
|
38
|
-
const workerDir = process.env["STRYKER_WORKER_DIR"] ?? (yield* die(/* @__PURE__ */ new Error("STRYKER_WORKER_DIR is not set")));
|
|
39
|
-
const fs = yield* FileSystem;
|
|
40
|
-
const path = yield* Path;
|
|
41
|
-
const raw = yield* fs.readFileString(path.join(workerDir, "options.json"));
|
|
42
|
-
return yield* decodeWorkerOptions(raw);
|
|
43
|
-
});
|
|
44
|
-
const TestRunnerHandlers = TestRunnerRpcs.toLayer(gen(function* () {
|
|
45
|
-
const options = yield* readWorkerOptions;
|
|
46
|
-
const runnerName = options.testRunner;
|
|
47
|
-
const failed = (phase) => (cause) => fail(new TestRunnerFailed({
|
|
48
|
-
cause: pretty(cause),
|
|
49
|
-
phase,
|
|
50
|
-
runnerName
|
|
51
|
-
}));
|
|
52
|
-
const loaded = yield* loadPlugins(options.plugins, process.cwd()).pipe(catchCause(failed("init")));
|
|
53
|
-
const underlying = yield* create(loaded.pluginsByKind, "TestRunner", runnerName).pipe(flatMap((contribution) => TestRunner.pipe(provide(contribution.layer))), provide(merge(succeed$1(RunConfiguration, options), succeed$1(SandboxDirectory, process.cwd()))), catchCause(failed("init")));
|
|
54
|
-
yield* underlying.init.pipe(catchCause(failed("init")));
|
|
55
|
-
yield* addFinalizer(() => underlying.dispose.pipe(ignore));
|
|
56
|
-
return {
|
|
57
|
-
capabilities: () => underlying.capabilities.pipe(catchCause(failed("capabilities"))),
|
|
58
|
-
dryRun: ({ options: runOptions }) => underlying.dryRun(runOptions).pipe(flatMap((result) => withCoverage(result, runOptions)), catchCause(failed("dryRun"))),
|
|
59
|
-
mutantRun: ({ options: runOptions }) => underlying.mutantRun(runOptions).pipe(map$1(normalizeMutantRun), catchCause(failed("mutantRun")))
|
|
60
|
-
};
|
|
61
|
-
})).pipe(provide$1(mergeAll(layer, layer$1)));
|
|
62
|
-
const MainLayer = layer$2(TestRunnerRpcs).pipe(provide$1(TestRunnerHandlers), provide$1(layerProtocolSocketServer), provide$1(layerNdjson), provide$1(layer$3({ path: workerSocketPath("test runner worker") })), provide$1(nodeModuleLayer));
|
|
63
|
-
launchWorker(MainLayer, "test runner worker");
|
|
64
|
-
//#endregion
|
|
65
|
-
export {};
|