@systemfsoftware/stryker-js 2.0.0 → 3.0.1
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 +38 -0
- package/dist/{Checker-DYgIIEai.d.mts → Checker-A8o5B3Ub.d.mts} +1 -1
- package/dist/Checker.d.mts +1 -1
- package/dist/{Evaluator-RZBS4oeh.d.mts → Evaluator-CnAN8-pZ.d.mts} +2 -2
- package/dist/Evaluator.d.mts +1 -1
- package/dist/ExitClass.d.mts +1 -1
- package/dist/ExitClass.mjs +20 -31
- package/dist/Metrics.d.mts +7 -0
- package/dist/Metrics.mjs +79 -0
- package/dist/Metrics.schema-BaVd6rXs.d.mts +50 -0
- package/dist/Metrics.schema-DZdoc46X.mjs +27 -0
- package/dist/{Mutant-BPRJTF8f.d.mts → Mutant-Ci25PsWA.d.mts} +6 -6
- package/dist/Mutant.d.mts +3 -2
- package/dist/Mutant.mjs +54 -78
- package/dist/{Mutant.schema-BTWhFTk4.mjs → Mutant.schema-H3r0ho_R.mjs} +3 -3
- package/dist/{Plugin-DcDAIBQi.d.mts → Plugin-BtItMchw.d.mts} +31 -13
- package/dist/Plugin-DXFdJP1l.mjs +105 -0
- package/dist/Plugin.d.mts +2 -2
- package/dist/Plugin.mjs +2 -2
- package/dist/Report.d.mts +2 -0
- package/dist/Report.mjs +98 -0
- package/dist/Report.schema-_buHXdnZ.d.mts +251 -0
- package/dist/Reporter-BWTwlSJf.mjs +25 -0
- package/dist/Reporter-C7ysGxqX.d.mts +16 -0
- package/dist/Reporter.d.mts +4 -2
- package/dist/Reporter.mjs +3 -2
- package/dist/ReporterEvent.d.mts +2 -0
- package/dist/ReporterEvent.mjs +57 -0
- package/dist/ReporterEvent.schema-BhtyYCZo.d.mts +189 -0
- package/dist/{Run-BnmGGgWj.d.mts → Run-BUpNSmcM.d.mts} +82 -89
- package/dist/Run.d.mts +2 -2
- package/dist/Run.mjs +56 -2
- package/dist/Run.schema-DZve3k2m.mjs +138 -0
- package/dist/{Schema-CXKiLnTu.d.mts → Schema-4oCWQ0P0.d.mts} +63 -64
- package/dist/{Schema-CdNkubPi.mjs → Schema-CMKdWMUN.mjs} +55 -57
- package/dist/Schema.d.mts +1 -1
- package/dist/Schema.mjs +1 -1
- package/dist/TestRunner.d.mts +1 -1
- package/dist/TestRunner.mjs +57 -2
- package/dist/{TestRunner-DC9U8Unb.mjs → TestRunner.schema-Dy0Wdro2.mjs} +2 -64
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +5 -5
- package/dist/provided-options.d.mts +1 -1
- package/package.json +10 -7
- package/dist/Plugin-Ceh1G8Dz.mjs +0 -117
- package/dist/Reporter-COVWW1my.mjs +0 -33
- package/dist/Reporter-eZ3M7lO6.d.mts +0 -83
- package/dist/Run-BcDo-hIC.mjs +0 -199
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as Checker_d_exports } from "./Checker-
|
|
2
|
-
import {
|
|
1
|
+
import { i as Checker_d_exports } from "./Checker-A8o5B3Ub.mjs";
|
|
2
|
+
import { X as TestRunner_d_exports, v as Mutant_d_exports } from "./Mutant-Ci25PsWA.mjs";
|
|
3
3
|
import { r as Ignorer_d_exports } from "./Ignorer-BUY68FZQ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
4
|
+
import { a as Schema_d_exports } from "./Schema-4oCWQ0P0.mjs";
|
|
5
|
+
import { s as Plugin_d_exports } from "./Plugin-BtItMchw.mjs";
|
|
6
|
+
import { n as Reporter_d_exports } from "./Reporter-C7ysGxqX.mjs";
|
|
7
|
+
import { a as Run_d_exports } from "./Run-BUpNSmcM.mjs";
|
|
8
8
|
export { Checker_d_exports as Checker, Ignorer_d_exports as Ignorer, Mutant_d_exports as Mutant, Plugin_d_exports as Plugin, Reporter_d_exports as Reporter, Run_d_exports as Run, Schema_d_exports as Schema, TestRunner_d_exports as TestRunner };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as Checker_exports } from "./Checker-Bq8NXD8d.mjs";
|
|
2
2
|
import { t as Ignorer_exports } from "./Ignorer.mjs";
|
|
3
3
|
import { t as Mutant_exports } from "./Mutant.mjs";
|
|
4
|
-
import { t as Plugin_exports } from "./Plugin-
|
|
5
|
-
import { n as Reporter_exports } from "./Reporter-
|
|
6
|
-
import {
|
|
7
|
-
import { n as Schema_exports } from "./Schema-
|
|
8
|
-
import {
|
|
4
|
+
import { t as Plugin_exports } from "./Plugin-DXFdJP1l.mjs";
|
|
5
|
+
import { n as Reporter_exports } from "./Reporter-BWTwlSJf.mjs";
|
|
6
|
+
import { t as Run_exports } from "./Run.mjs";
|
|
7
|
+
import { n as Schema_exports } from "./Schema-CMKdWMUN.mjs";
|
|
8
|
+
import { t as TestRunner_exports } from "./TestRunner.mjs";
|
|
9
9
|
export { Checker_exports as Checker, Ignorer_exports as Ignorer, Mutant_exports as Mutant, Plugin_exports as Plugin, Reporter_exports as Reporter, Run_exports as Run, Schema_exports as Schema, TestRunner_exports as TestRunner };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"node": ">=20.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"effect": "
|
|
22
|
-
"
|
|
23
|
-
"@systemfsoftware/effect-cell-types": "^6.0.1"
|
|
21
|
+
"effect": "4.0.0-rc.112",
|
|
22
|
+
"@systemfsoftware/effect-cell-types": "^7.0.0"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
25
|
+
"@effect/vitest": "4.0.0-rc.112",
|
|
26
26
|
"@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
|
|
27
27
|
"@types/node": "^24",
|
|
28
28
|
"oxlint": "^1.77.0",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"tsdown": "^0.22.14",
|
|
32
32
|
"typescript": "^7",
|
|
33
33
|
"vitest": "^4",
|
|
34
|
-
"@systemfsoftware/all": "^
|
|
35
|
-
"@systemfsoftware/effect-schema-
|
|
34
|
+
"@systemfsoftware/all": "^2.0.0",
|
|
35
|
+
"@systemfsoftware/effect-schema-law": "^2.1.0",
|
|
36
36
|
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
37
37
|
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
38
|
-
"@systemfsoftware/effect-schema-
|
|
38
|
+
"@systemfsoftware/effect-schema-vite": "^2.1.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public",
|
|
@@ -47,12 +47,15 @@
|
|
|
47
47
|
"./Evaluator": "./dist/Evaluator.mjs",
|
|
48
48
|
"./ExitClass": "./dist/ExitClass.mjs",
|
|
49
49
|
"./Ignorer": "./dist/Ignorer.mjs",
|
|
50
|
+
"./Metrics": "./dist/Metrics.mjs",
|
|
50
51
|
"./Module": "./dist/Module.mjs",
|
|
51
52
|
"./Mutant": "./dist/Mutant.mjs",
|
|
52
53
|
"./output-file": "./dist/output-file.mjs",
|
|
53
54
|
"./Plugin": "./dist/Plugin.mjs",
|
|
54
55
|
"./provided-options": "./dist/provided-options.mjs",
|
|
56
|
+
"./Report": "./dist/Report.mjs",
|
|
55
57
|
"./Reporter": "./dist/Reporter.mjs",
|
|
58
|
+
"./ReporterEvent": "./dist/ReporterEvent.mjs",
|
|
56
59
|
"./Run": "./dist/Run.mjs",
|
|
57
60
|
"./Schema": "./dist/Schema.mjs",
|
|
58
61
|
"./TestRunner": "./dist/TestRunner.mjs",
|
package/dist/Plugin-Ceh1G8Dz.mjs
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import { t as Reporter } from "./Reporter-COVWW1my.mjs";
|
|
3
|
-
import * as Context from "effect/Context";
|
|
4
|
-
import * as S from "effect/Schema";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
|
-
import * as Layer from "effect/Layer";
|
|
7
|
-
import * as MutableHashMap from "effect/MutableHashMap";
|
|
8
|
-
import * as Option from "effect/Option";
|
|
9
|
-
//#region src/Plugin.schema.ts
|
|
10
|
-
const PluginKind = S.Literals([
|
|
11
|
-
"Checker",
|
|
12
|
-
"TestRunner",
|
|
13
|
-
"Reporter",
|
|
14
|
-
"Ignore",
|
|
15
|
-
"Evaluator"
|
|
16
|
-
]);
|
|
17
|
-
var PluginContribution = class extends S.TaggedClass()("PluginContribution", {
|
|
18
|
-
kind: PluginKind,
|
|
19
|
-
name: S.String,
|
|
20
|
-
layer: S.Unknown
|
|
21
|
-
}) {};
|
|
22
|
-
var Shadowing = class extends S.TaggedClass()("Shadowing", {
|
|
23
|
-
kind: S.String,
|
|
24
|
-
name: S.String,
|
|
25
|
-
shadowedIndex: S.Finite,
|
|
26
|
-
winnerIndex: S.Finite
|
|
27
|
-
}) {};
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/Plugin.ts
|
|
30
|
-
var Plugin_exports = /* @__PURE__ */ __exportAll({
|
|
31
|
-
PluginContribution: () => PluginContribution,
|
|
32
|
-
PluginKind: () => PluginKind,
|
|
33
|
-
RunConfiguration: () => RunConfiguration,
|
|
34
|
-
SandboxDirectory: () => SandboxDirectory,
|
|
35
|
-
Shadowing: () => Shadowing,
|
|
36
|
-
composePlugins: () => composePlugins,
|
|
37
|
-
declarePlugin: () => declarePlugin
|
|
38
|
-
});
|
|
39
|
-
var RunConfiguration = class extends Context.Service()("~@systemfsoftware/stryker-js/RunConfiguration") {};
|
|
40
|
-
var SandboxDirectory = class extends Context.Service()("~@systemfsoftware/stryker-js/SandboxDirectory") {};
|
|
41
|
-
function declarePlugin(kind, name, layer) {
|
|
42
|
-
return new PluginContribution({
|
|
43
|
-
kind,
|
|
44
|
-
name,
|
|
45
|
-
layer
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function foldContributions(contributions) {
|
|
49
|
-
const resolved = MutableHashMap.empty();
|
|
50
|
-
const shadowings = [];
|
|
51
|
-
const lastSeen = MutableHashMap.empty();
|
|
52
|
-
for (const [index, contribution] of contributions.entries()) {
|
|
53
|
-
const key = `${contribution.kind}:${contribution.name}`;
|
|
54
|
-
const previous = MutableHashMap.get(lastSeen, key);
|
|
55
|
-
if (Option.isSome(previous)) shadowings.push(new Shadowing({
|
|
56
|
-
kind: String(contribution.kind),
|
|
57
|
-
name: contribution.name,
|
|
58
|
-
shadowedIndex: previous.value,
|
|
59
|
-
winnerIndex: index
|
|
60
|
-
}));
|
|
61
|
-
MutableHashMap.set(resolved, key, contribution);
|
|
62
|
-
MutableHashMap.set(lastSeen, key, index);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
resolved,
|
|
66
|
-
shadowings
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function composePlugins(contributions) {
|
|
70
|
-
const { resolved, shadowings } = foldContributions(contributions);
|
|
71
|
-
const allResolved = Array.from(MutableHashMap.values(resolved));
|
|
72
|
-
const reporterContributions = allResolved.filter((c) => c.kind === "Reporter");
|
|
73
|
-
const nonReporterLayers = allResolved.filter((c) => c.kind !== "Reporter").map((contribution) => contribution.layer);
|
|
74
|
-
let broadcastLayer;
|
|
75
|
-
if (reporterContributions.length > 0) broadcastLayer = Layer.effect(Reporter, Effect.gen(function* () {
|
|
76
|
-
const config = yield* RunConfiguration;
|
|
77
|
-
const wantedNames = {};
|
|
78
|
-
for (const name of config.reporters) wantedNames[name.toLowerCase()] = true;
|
|
79
|
-
const selected = reporterContributions.filter((c) => c.name.toLowerCase() in wantedNames);
|
|
80
|
-
const sandboxOption = yield* Effect.serviceOption(SandboxDirectory);
|
|
81
|
-
const namedReporters = [];
|
|
82
|
-
for (const contribution of selected) {
|
|
83
|
-
let buildEffect = Layer.build(contribution.layer).pipe(Effect.provideService(RunConfiguration, config));
|
|
84
|
-
if (Option.isSome(sandboxOption)) buildEffect = buildEffect.pipe(Effect.provideService(SandboxDirectory, sandboxOption.value));
|
|
85
|
-
const ctx = yield* buildEffect;
|
|
86
|
-
const reporter = Context.get(ctx, Reporter);
|
|
87
|
-
namedReporters.push({
|
|
88
|
-
name: contribution.name,
|
|
89
|
-
reporter
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
const toEach = (event, call) => Effect.forEach(namedReporters, ({ name, reporter }) => call(reporter).pipe(Effect.catchCause((cause) => Effect.logWarning(`Reporter "${name}" failed handling ${event}`).pipe(Effect.annotateLogs("cause", cause)))), {
|
|
93
|
-
concurrency: "unbounded",
|
|
94
|
-
discard: true
|
|
95
|
-
});
|
|
96
|
-
return {
|
|
97
|
-
onDryRunCompleted: (event) => toEach("onDryRunCompleted", (r) => r.onDryRunCompleted(event)),
|
|
98
|
-
onMutationTestingPlanReady: (event) => toEach("onMutationTestingPlanReady", (r) => r.onMutationTestingPlanReady(event)),
|
|
99
|
-
onMutantTested: (result) => toEach("onMutantTested", (r) => r.onMutantTested(result)),
|
|
100
|
-
onMutationTestReportReady: (report, metrics) => toEach("onMutationTestReportReady", (r) => r.onMutationTestReportReady(report, metrics)),
|
|
101
|
-
wrapUp: toEach("wrapUp", (r) => r.wrapUp)
|
|
102
|
-
};
|
|
103
|
-
}));
|
|
104
|
-
const allLayers = [...nonReporterLayers];
|
|
105
|
-
if (broadcastLayer !== void 0) allLayers.push(broadcastLayer);
|
|
106
|
-
if (allLayers.length === 0) return {
|
|
107
|
-
layer: Option.none(),
|
|
108
|
-
shadowings
|
|
109
|
-
};
|
|
110
|
-
const merged = allLayers.reduce((acc, next) => Layer.merge(acc, next));
|
|
111
|
-
return {
|
|
112
|
-
layer: Option.some(merged),
|
|
113
|
-
shadowings
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
//#endregion
|
|
117
|
-
export { declarePlugin as a, Shadowing as c, composePlugins as i, RunConfiguration as n, PluginContribution as o, SandboxDirectory as r, PluginKind as s, Plugin_exports as t };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import * as Context from "effect/Context";
|
|
3
|
-
import * as S from "effect/Schema";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
//#region src/Reporter.schema.ts
|
|
6
|
-
var ReporterFailed = class extends S.TaggedError()("ReporterFailed", {
|
|
7
|
-
cause: S.String,
|
|
8
|
-
event: S.Literals([
|
|
9
|
-
"onDryRunCompleted",
|
|
10
|
-
"onMutationTestingPlanReady",
|
|
11
|
-
"onMutantTested",
|
|
12
|
-
"onMutationTestReportReady",
|
|
13
|
-
"wrapUp"
|
|
14
|
-
]),
|
|
15
|
-
reporterName: S.String
|
|
16
|
-
}) {};
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/Reporter.ts
|
|
19
|
-
var Reporter_exports = /* @__PURE__ */ __exportAll({
|
|
20
|
-
Reporter: () => Reporter,
|
|
21
|
-
ReporterFailed: () => ReporterFailed,
|
|
22
|
-
broadcastReporter: () => broadcastReporter
|
|
23
|
-
});
|
|
24
|
-
var Reporter = class extends Context.Service()("~@systemfsoftware/stryker-js/Reporter") {};
|
|
25
|
-
const broadcastReporter = (reporters) => ({
|
|
26
|
-
onDryRunCompleted: (event) => Effect.forEach(reporters, (r) => r.reporter.onDryRunCompleted(event), { discard: true }),
|
|
27
|
-
onMutationTestingPlanReady: (event) => Effect.forEach(reporters, (r) => r.reporter.onMutationTestingPlanReady(event), { discard: true }),
|
|
28
|
-
onMutantTested: (result) => Effect.forEach(reporters, (r) => r.reporter.onMutantTested(result), { discard: true }),
|
|
29
|
-
onMutationTestReportReady: (report, metrics) => Effect.forEach(reporters, (r) => r.reporter.onMutationTestReportReady(report, metrics), { discard: true }),
|
|
30
|
-
wrapUp: Effect.forEach(reporters, (r) => r.reporter.wrapUp, { discard: true }).pipe(Effect.asVoid)
|
|
31
|
-
});
|
|
32
|
-
//#endregion
|
|
33
|
-
export { ReporterFailed as i, Reporter_exports as n, broadcastReporter as r, Reporter as t };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { S as TestPlan, p as MutantResult } from "./Mutant-BPRJTF8f.mjs";
|
|
2
|
-
import * as Context from "effect/Context";
|
|
3
|
-
import * as S from "effect/Schema";
|
|
4
|
-
import * as schema from "mutation-testing-report-schema/api";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
|
-
//#region src/Reporter.schema.d.ts
|
|
7
|
-
declare const ReporterFailed_base: S.Class<ReporterFailed, S.TaggedStruct<"ReporterFailed", {
|
|
8
|
-
readonly cause: S.String;
|
|
9
|
-
readonly event: S.Literals<readonly ["onDryRunCompleted", "onMutationTestingPlanReady", "onMutantTested", "onMutationTestReportReady", "wrapUp"]>;
|
|
10
|
-
readonly reporterName: S.String;
|
|
11
|
-
}>, import("effect/Cause").YieldableError>;
|
|
12
|
-
declare class ReporterFailed extends ReporterFailed_base {}
|
|
13
|
-
declare namespace Reporter_d_exports {
|
|
14
|
-
export { CompleteDryRunResultForReporter, DryRunCompletedEvent, Metrics, MetricsResult, MutationTestMetricsResult, MutationTestingPlanReadyEvent, NamedReporter, Reporter, ReporterFailed, ReporterService, RunTiming, TestMetrics, TestRunnerCapabilities, broadcastReporter };
|
|
15
|
-
}
|
|
16
|
-
interface Metrics {
|
|
17
|
-
readonly pending: number;
|
|
18
|
-
readonly killed: number;
|
|
19
|
-
readonly timeout: number;
|
|
20
|
-
readonly survived: number;
|
|
21
|
-
readonly noCoverage: number;
|
|
22
|
-
readonly runtimeErrors: number;
|
|
23
|
-
readonly compileErrors: number;
|
|
24
|
-
readonly ignored: number;
|
|
25
|
-
readonly totalDetected: number;
|
|
26
|
-
readonly totalUndetected: number;
|
|
27
|
-
readonly totalInvalid: number;
|
|
28
|
-
readonly totalValid: number;
|
|
29
|
-
readonly totalMutants: number;
|
|
30
|
-
readonly totalCovered: number;
|
|
31
|
-
readonly mutationScore: number;
|
|
32
|
-
readonly mutationScoreBasedOnCoveredCode: number;
|
|
33
|
-
}
|
|
34
|
-
interface TestMetrics {
|
|
35
|
-
readonly total: number;
|
|
36
|
-
readonly killing: number;
|
|
37
|
-
readonly covering: number;
|
|
38
|
-
readonly notCovering: number;
|
|
39
|
-
}
|
|
40
|
-
interface MetricsResult<TMetrics> {
|
|
41
|
-
readonly name: string;
|
|
42
|
-
readonly metrics: TMetrics;
|
|
43
|
-
readonly childResults: readonly MetricsResult<TMetrics>[];
|
|
44
|
-
}
|
|
45
|
-
interface MutationTestMetricsResult {
|
|
46
|
-
readonly systemUnderTestMetrics: MetricsResult<Metrics>;
|
|
47
|
-
readonly testMetrics: MetricsResult<TestMetrics> | undefined;
|
|
48
|
-
}
|
|
49
|
-
interface RunTiming {
|
|
50
|
-
readonly net: number;
|
|
51
|
-
readonly overhead: number;
|
|
52
|
-
}
|
|
53
|
-
interface CompleteDryRunResultForReporter {
|
|
54
|
-
readonly tests: readonly unknown[];
|
|
55
|
-
readonly status: 'complete';
|
|
56
|
-
}
|
|
57
|
-
interface TestRunnerCapabilities {
|
|
58
|
-
readonly reloadEnvironment: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface DryRunCompletedEvent {
|
|
61
|
-
readonly result: CompleteDryRunResultForReporter;
|
|
62
|
-
readonly timing: RunTiming;
|
|
63
|
-
readonly capabilities: TestRunnerCapabilities;
|
|
64
|
-
}
|
|
65
|
-
interface MutationTestingPlanReadyEvent {
|
|
66
|
-
readonly mutantPlans: readonly TestPlan[];
|
|
67
|
-
}
|
|
68
|
-
interface ReporterService {
|
|
69
|
-
readonly onDryRunCompleted: (event: DryRunCompletedEvent) => Effect.Effect<void, ReporterFailed>;
|
|
70
|
-
readonly onMutationTestingPlanReady: (event: MutationTestingPlanReadyEvent) => Effect.Effect<void, ReporterFailed>;
|
|
71
|
-
readonly onMutantTested: (result: Readonly<MutantResult>) => Effect.Effect<void, ReporterFailed>;
|
|
72
|
-
readonly onMutationTestReportReady: (report: Readonly<schema.MutationTestResult>, metrics: Readonly<MutationTestMetricsResult>) => Effect.Effect<void, ReporterFailed>;
|
|
73
|
-
readonly wrapUp: Effect.Effect<void, ReporterFailed>;
|
|
74
|
-
}
|
|
75
|
-
interface NamedReporter {
|
|
76
|
-
readonly name: string;
|
|
77
|
-
readonly reporter: ReporterService;
|
|
78
|
-
}
|
|
79
|
-
declare const Reporter_base: Context.ServiceClass<Reporter, "~@systemfsoftware/stryker-js/Reporter", ReporterService>;
|
|
80
|
-
declare class Reporter extends Reporter_base {}
|
|
81
|
-
declare const broadcastReporter: (reporters: readonly NamedReporter[]) => ReporterService;
|
|
82
|
-
//#endregion
|
|
83
|
-
export { MutationTestMetricsResult as a, Reporter as c, RunTiming as d, TestMetrics as f, ReporterFailed as h, MetricsResult as i, ReporterService as l, broadcastReporter as m, DryRunCompletedEvent as n, MutationTestingPlanReadyEvent as o, TestRunnerCapabilities as p, Metrics as r, NamedReporter as s, CompleteDryRunResultForReporter as t, Reporter_d_exports as u };
|
package/dist/Run-BcDo-hIC.mjs
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import * as Context from "effect/Context";
|
|
3
|
-
import * as S from "effect/Schema";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Exit from "effect/Exit";
|
|
6
|
-
import * as Result from "effect/Result";
|
|
7
|
-
import { Wire } from "@systemfsoftware/effect-cell-types";
|
|
8
|
-
//#region src/Run.schema.ts
|
|
9
|
-
const RunPhase = S.Literals([
|
|
10
|
-
"prepare",
|
|
11
|
-
"instrument",
|
|
12
|
-
"dry-run",
|
|
13
|
-
"mutation-test"
|
|
14
|
-
]);
|
|
15
|
-
const OutputMode = S.Literals(["human", "machine"]);
|
|
16
|
-
const ModeSignal = S.Literals([
|
|
17
|
-
"flag",
|
|
18
|
-
"env",
|
|
19
|
-
"tty",
|
|
20
|
-
"agent",
|
|
21
|
-
"tool"
|
|
22
|
-
]);
|
|
23
|
-
const MutantStatus = S.Literals([
|
|
24
|
-
"Killed",
|
|
25
|
-
"Survived",
|
|
26
|
-
"NoCoverage",
|
|
27
|
-
"Timeout",
|
|
28
|
-
"CompileError",
|
|
29
|
-
"RuntimeError",
|
|
30
|
-
"Ignored",
|
|
31
|
-
"Pending"
|
|
32
|
-
]);
|
|
33
|
-
const Position = Wire.wire({
|
|
34
|
-
line: Wire.mint(S.Finite),
|
|
35
|
-
column: Wire.mint(S.Finite)
|
|
36
|
-
});
|
|
37
|
-
const Location = Wire.wire({
|
|
38
|
-
start: Position,
|
|
39
|
-
end: Position
|
|
40
|
-
});
|
|
41
|
-
var RunStarted = class extends S.TaggedClass()("stream", {
|
|
42
|
-
schemaVersion: Wire.mint(S.String),
|
|
43
|
-
runId: Wire.mint(S.String),
|
|
44
|
-
mode: OutputMode,
|
|
45
|
-
signal: ModeSignal
|
|
46
|
-
}) {};
|
|
47
|
-
var PhaseEntered = class extends S.TaggedClass()("phase", {
|
|
48
|
-
phase: RunPhase,
|
|
49
|
-
elapsedMs: Wire.mint(S.Finite)
|
|
50
|
-
}) {};
|
|
51
|
-
var PlanKnown = class extends S.TaggedClass()("plan", { total: Wire.mint(S.Finite) }) {};
|
|
52
|
-
var MutantTested = class extends S.TaggedClass()("mutant", {
|
|
53
|
-
id: Wire.mint(S.String),
|
|
54
|
-
status: MutantStatus,
|
|
55
|
-
file: Wire.mint(S.String),
|
|
56
|
-
location: Location,
|
|
57
|
-
mutator: Wire.mint(S.String),
|
|
58
|
-
replacement: Wire.mint(S.NullOr(Wire.mint(S.String))),
|
|
59
|
-
completed: Wire.mint(S.Finite),
|
|
60
|
-
total: Wire.mint(S.Finite)
|
|
61
|
-
}) {};
|
|
62
|
-
var Heartbeat = class extends S.TaggedClass()("tick", {
|
|
63
|
-
elapsedMs: Wire.mint(S.Finite),
|
|
64
|
-
completed: Wire.mint(S.Finite),
|
|
65
|
-
total: Wire.mint(S.NullOr(Wire.mint(S.Finite)))
|
|
66
|
-
}) {};
|
|
67
|
-
const VerdictThresholds = Wire.wire({
|
|
68
|
-
high: Wire.mint(S.Finite),
|
|
69
|
-
low: Wire.mint(S.Finite),
|
|
70
|
-
break: Wire.mint(S.NullOr(Wire.mint(S.Finite)))
|
|
71
|
-
});
|
|
72
|
-
const VerdictMutant = S.Struct({
|
|
73
|
-
id: Wire.mint(S.String),
|
|
74
|
-
file: Wire.mint(S.String),
|
|
75
|
-
location: Location,
|
|
76
|
-
mutator: Wire.mint(S.String),
|
|
77
|
-
replacement: Wire.mint(S.NullOr(Wire.mint(S.String))),
|
|
78
|
-
status: MutantStatus
|
|
79
|
-
});
|
|
80
|
-
const VerdictCounts = Wire.wire({
|
|
81
|
-
killed: Wire.mint(S.Finite),
|
|
82
|
-
timeout: Wire.mint(S.Finite),
|
|
83
|
-
survived: Wire.mint(S.Finite),
|
|
84
|
-
noCoverage: Wire.mint(S.Finite),
|
|
85
|
-
runtimeErrors: Wire.mint(S.Finite),
|
|
86
|
-
compileErrors: Wire.mint(S.Finite),
|
|
87
|
-
ignored: Wire.mint(S.Finite),
|
|
88
|
-
pending: Wire.mint(S.Finite)
|
|
89
|
-
});
|
|
90
|
-
var VerdictReached = class extends S.TaggedClass()("verdict", {
|
|
91
|
-
schemaVersion: Wire.mint(S.String),
|
|
92
|
-
runId: Wire.mint(S.String),
|
|
93
|
-
mode: OutputMode,
|
|
94
|
-
signal: ModeSignal,
|
|
95
|
-
score: Wire.mint(S.NullOr(Wire.mint(S.Finite))),
|
|
96
|
-
thresholds: VerdictThresholds,
|
|
97
|
-
reportFile: Wire.mint(S.NullOr(Wire.mint(S.String))),
|
|
98
|
-
counts: VerdictCounts,
|
|
99
|
-
mutants: S.Array(VerdictMutant)
|
|
100
|
-
}) {};
|
|
101
|
-
var RunFailed = class extends S.TaggedClass()("error", {
|
|
102
|
-
schemaVersion: Wire.mint(S.String),
|
|
103
|
-
code: Wire.mint(S.Finite),
|
|
104
|
-
error: Wire.mint(S.String),
|
|
105
|
-
remediation: Wire.mint(S.String)
|
|
106
|
-
}) {};
|
|
107
|
-
var HelpRendered = class extends S.TaggedClass()("help", {
|
|
108
|
-
schemaVersion: Wire.mint(S.String),
|
|
109
|
-
code: Wire.mint(S.Literals([0])),
|
|
110
|
-
help: Wire.mint(S.String)
|
|
111
|
-
}) {};
|
|
112
|
-
var ManifestRendered = class extends S.TaggedClass()("manifest", {
|
|
113
|
-
schemaVersion: Wire.mint(S.String),
|
|
114
|
-
code: Wire.mint(S.Literals([0])),
|
|
115
|
-
manifest: Wire.mint(S.String)
|
|
116
|
-
}) {};
|
|
117
|
-
const RunEvent = S.Union([
|
|
118
|
-
RunStarted,
|
|
119
|
-
PhaseEntered,
|
|
120
|
-
PlanKnown,
|
|
121
|
-
MutantTested,
|
|
122
|
-
Heartbeat,
|
|
123
|
-
VerdictReached,
|
|
124
|
-
RunFailed,
|
|
125
|
-
HelpRendered,
|
|
126
|
-
ManifestRendered
|
|
127
|
-
]);
|
|
128
|
-
S.TaggedClass()("RunCommand", {
|
|
129
|
-
cliOptionsJson: S.String,
|
|
130
|
-
targetMutatePatterns: S.Array(S.String)
|
|
131
|
-
});
|
|
132
|
-
var RunOutput = class extends S.TaggedClass()("RunOutput", {
|
|
133
|
-
verdictJson: S.String,
|
|
134
|
-
exitCode: S.Finite
|
|
135
|
-
}) {};
|
|
136
|
-
S.TaggedError()("RunDecodeError", { message: S.String });
|
|
137
|
-
S.TaggedError()("RunReadError", { message: S.String });
|
|
138
|
-
S.TaggedError()("RunWriteError", { message: S.String });
|
|
139
|
-
var PlanMutationRunCommand = class extends S.TaggedClass()("PlanMutationRunCommand", {
|
|
140
|
-
configMutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
|
|
141
|
-
configMutatorNames: Wire.mint(S.Array(Wire.mint(S.String))),
|
|
142
|
-
targetMutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
|
|
143
|
-
availableMutators: Wire.mint(S.Array(Wire.mint(S.String)))
|
|
144
|
-
}) {};
|
|
145
|
-
var MutationRunPlan = class extends S.TaggedClass()("MutationRunPlan", {
|
|
146
|
-
mutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
|
|
147
|
-
mutatorNames: Wire.mint(S.Array(Wire.mint(S.String)))
|
|
148
|
-
}) {};
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/Run.ts
|
|
151
|
-
var Run_exports = /* @__PURE__ */ __exportAll({
|
|
152
|
-
Heartbeat: () => Heartbeat,
|
|
153
|
-
HelpRendered: () => HelpRendered,
|
|
154
|
-
ManifestRendered: () => ManifestRendered,
|
|
155
|
-
ModeSignal: () => ModeSignal,
|
|
156
|
-
MutantStatus: () => MutantStatus,
|
|
157
|
-
MutantTested: () => MutantTested,
|
|
158
|
-
OutputMode: () => OutputMode,
|
|
159
|
-
PhaseEntered: () => PhaseEntered,
|
|
160
|
-
PlanKnown: () => PlanKnown,
|
|
161
|
-
RunEvent: () => RunEvent,
|
|
162
|
-
RunEvents: () => RunEvents,
|
|
163
|
-
RunFailed: () => RunFailed,
|
|
164
|
-
RunIdentity: () => RunIdentity,
|
|
165
|
-
RunPhase: () => RunPhase,
|
|
166
|
-
RunStarted: () => RunStarted,
|
|
167
|
-
VerdictReached: () => VerdictReached,
|
|
168
|
-
planMutationRun: () => planMutationRun,
|
|
169
|
-
runMutationTest: () => runMutationTest,
|
|
170
|
-
shouldKeepTempDir: () => shouldKeepTempDir
|
|
171
|
-
});
|
|
172
|
-
const firstNonEmpty = (preferred, fallback) => {
|
|
173
|
-
if (preferred.length > 0) return [...preferred];
|
|
174
|
-
return [...fallback];
|
|
175
|
-
};
|
|
176
|
-
const planMutationRun = (command) => MutationRunPlan.make({
|
|
177
|
-
mutatePatterns: firstNonEmpty(command.targetMutatePatterns, command.configMutatePatterns),
|
|
178
|
-
mutatorNames: firstNonEmpty(command.availableMutators, command.configMutatorNames)
|
|
179
|
-
});
|
|
180
|
-
var RunEvents = class extends Context.Service()("~@systemfsoftware/stryker-js/RunEvents") {};
|
|
181
|
-
var RunIdentity = class extends Context.Service()("~@systemfsoftware/stryker-js/RunIdentity") {};
|
|
182
|
-
const runMutationTest = (io, command) => Effect.gen(function* () {
|
|
183
|
-
const raw = yield* io.read(command);
|
|
184
|
-
const planCommand = yield* Result.match(S.decodeUnknownResult(PlanMutationRunCommand)(raw), {
|
|
185
|
-
onFailure: (error) => Effect.fail(error),
|
|
186
|
-
onSuccess: (decoded) => Effect.succeed(decoded)
|
|
187
|
-
});
|
|
188
|
-
const plan = planMutationRun(planCommand);
|
|
189
|
-
return yield* io.write(new RunOutput({
|
|
190
|
-
verdictJson: JSON.stringify({
|
|
191
|
-
mutate: plan.mutatePatterns,
|
|
192
|
-
mutatorNames: plan.mutatorNames
|
|
193
|
-
}),
|
|
194
|
-
exitCode: 0
|
|
195
|
-
}));
|
|
196
|
-
});
|
|
197
|
-
const shouldKeepTempDir = (exit, cleanTempDir) => Exit.isFailure(exit) && cleanTempDir !== "always";
|
|
198
|
-
//#endregion
|
|
199
|
-
export { RunFailed as _, runMutationTest as a, VerdictReached as b, HelpRendered as c, MutantStatus as d, MutantTested as f, RunEvent as g, PlanKnown as h, planMutationRun as i, ManifestRendered as l, PhaseEntered as m, RunIdentity as n, shouldKeepTempDir as o, OutputMode as p, Run_exports as r, Heartbeat as s, RunEvents as t, ModeSignal as u, RunPhase as v, RunStarted as y };
|