@systemfsoftware/stryker-js-instrumenter 7.0.0 → 8.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 +16 -0
- package/dist/index.d.mts +196 -22
- package/dist/index.mjs +2100 -1894
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-instrumenter
|
|
2
2
|
|
|
3
|
+
## 8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- The built-in reporters, plugin loading and their types are no longer published
|
|
8
|
+
from separate entry points on `@systemfsoftware/stryker-js`; import them from
|
|
9
|
+
`@systemfsoftware/stryker-js`. The mutant vocabulary — `Mutant`, `Location`,
|
|
10
|
+
`Position` and their schemas — is importable only from
|
|
11
|
+
`@systemfsoftware/stryker-js-instrumenter`.
|
|
12
|
+
|
|
13
|
+
## 7.1.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- Types that appear on the published CLI and instrumenter APIs are now exported.
|
|
18
|
+
|
|
3
19
|
## 7.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,73 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { FileDescription } from '@systemfsoftware/stryker-js-language';
|
|
3
|
-
import { Mutant } from '@systemfsoftware/stryker-js-language';
|
|
4
2
|
import * as S from 'effect/Schema';
|
|
5
3
|
import { YieldableError } from 'effect/Cause';
|
|
6
4
|
|
|
5
|
+
export declare const causeText: (cause: unknown, depth: number) => string | undefined;
|
|
6
|
+
|
|
7
|
+
export declare interface Coverage {
|
|
8
|
+
readonly static: CoverageData;
|
|
9
|
+
readonly perTest: CoveragePerTestId;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare type CoverageData = Record<string, number>;
|
|
13
|
+
|
|
14
|
+
export declare type CoveragePerTestId = Record<string, CoverageData>;
|
|
15
|
+
|
|
7
16
|
export declare const disableTypeChecks: (file: File_2) => Effect.Effect<File_2, InstrumentError>;
|
|
8
17
|
|
|
18
|
+
export declare interface EarlyResultPlan {
|
|
19
|
+
readonly plan: 'EarlyResult';
|
|
20
|
+
readonly mutant: Mutant;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare interface ErrnoException extends Error {
|
|
24
|
+
code?: string;
|
|
25
|
+
errno?: number;
|
|
26
|
+
path?: string;
|
|
27
|
+
syscall?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare const ERROR_CODES: Readonly<{
|
|
31
|
+
NoSuchFileOrDirectory: 'ENOENT';
|
|
32
|
+
}>;
|
|
33
|
+
|
|
34
|
+
export declare function errorToString(error: unknown): string;
|
|
35
|
+
|
|
9
36
|
declare interface File_2 extends FileDescription {
|
|
10
37
|
name: string;
|
|
11
38
|
content: string;
|
|
12
39
|
}
|
|
13
40
|
export { File_2 as File }
|
|
14
41
|
|
|
15
|
-
export declare
|
|
42
|
+
export declare interface FileDescription {
|
|
43
|
+
readonly mutate: MutateDescription;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare type FileDescriptions = Record<string, FileDescription>;
|
|
47
|
+
|
|
48
|
+
export declare const instrument: (files: readonly File_2[], options: InstrumenterOptions, basePath?: string) => Effect.Effect<InstrumentResult, InstrumentError>;
|
|
49
|
+
|
|
50
|
+
export declare const INSTRUMENTER_CONSTANTS: Readonly<{
|
|
51
|
+
NAMESPACE: '__stryker__';
|
|
52
|
+
MUTATION_COVERAGE_OBJECT: 'mutantCoverage';
|
|
53
|
+
ACTIVE_MUTANT: 'activeMutant';
|
|
54
|
+
CURRENT_TEST_ID: 'currentTestId';
|
|
55
|
+
HIT_COUNT: 'hitCount';
|
|
56
|
+
HIT_LIMIT: 'hitLimit';
|
|
57
|
+
ACTIVE_MUTANT_ENV_VARIABLE: '__STRYKER_ACTIVE_MUTANT__';
|
|
58
|
+
}>;
|
|
59
|
+
|
|
60
|
+
export declare interface InstrumenterContext {
|
|
61
|
+
activeMutant?: string;
|
|
62
|
+
currentTestId?: string;
|
|
63
|
+
mutantCoverage?: MutantCoverage;
|
|
64
|
+
hitCount?: number;
|
|
65
|
+
hitLimit?: number;
|
|
66
|
+
}
|
|
16
67
|
|
|
17
68
|
export declare type InstrumenterOptions = typeof InstrumenterOptionsSchema.Type;
|
|
18
69
|
|
|
19
|
-
declare const InstrumenterOptionsSchema: S.Struct<{
|
|
70
|
+
export declare const InstrumenterOptionsSchema: S.Struct<{
|
|
20
71
|
readonly excludedMutations: S.$Array<S.String>;
|
|
21
72
|
readonly ignorers: S.$Array<S.Unknown>;
|
|
22
73
|
readonly noHeader: S.optional<S.Boolean>;
|
|
@@ -31,31 +82,154 @@ declare const InstrumentError_base: S.Class<InstrumentError, S.TaggedStruct<"Ins
|
|
|
31
82
|
readonly cause: S.Defect;
|
|
32
83
|
}>, YieldableError>;
|
|
33
84
|
|
|
34
|
-
declare class InstrumentResult$1 extends InstrumentResult_base {}
|
|
35
|
-
|
|
36
85
|
export declare interface InstrumentResult {
|
|
37
86
|
files: readonly File_2[];
|
|
38
87
|
mutants: readonly Mutant[];
|
|
39
88
|
}
|
|
40
89
|
|
|
41
|
-
declare
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
90
|
+
export declare function isErrnoException(error: unknown): error is ErrnoException;
|
|
91
|
+
|
|
92
|
+
export declare const isMutant: (value: unknown) => value is Mutant;
|
|
93
|
+
|
|
94
|
+
export declare type Location = typeof LocationSchema.Type;
|
|
95
|
+
|
|
96
|
+
export declare const LocationSchema: S.Struct<{
|
|
97
|
+
readonly start: S.Struct<{
|
|
98
|
+
readonly line: S.Finite;
|
|
99
|
+
readonly column: S.Finite;
|
|
100
|
+
}>;
|
|
101
|
+
readonly end: S.Struct<{
|
|
102
|
+
readonly line: S.Finite;
|
|
103
|
+
readonly column: S.Finite;
|
|
104
|
+
}>;
|
|
105
|
+
}>;
|
|
106
|
+
|
|
107
|
+
export declare class Mutant extends Mutant_base {}
|
|
108
|
+
|
|
109
|
+
declare const Mutant_base: S.Class<Mutant, S.TaggedStruct<"Mutant", {
|
|
110
|
+
readonly id: S.NonEmptyString;
|
|
111
|
+
readonly fileName: S.NonEmptyString;
|
|
112
|
+
readonly mutatorName: S.NonEmptyString;
|
|
113
|
+
readonly replacement: S.String;
|
|
114
|
+
readonly location: S.Struct<{
|
|
115
|
+
readonly start: S.Struct<{
|
|
116
|
+
readonly line: S.Finite;
|
|
117
|
+
readonly column: S.Finite;
|
|
118
|
+
}>;
|
|
119
|
+
readonly end: S.Struct<{
|
|
120
|
+
readonly line: S.Finite;
|
|
121
|
+
readonly column: S.Finite;
|
|
122
|
+
}>;
|
|
123
|
+
}>;
|
|
124
|
+
readonly status: S.optional<S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>>;
|
|
125
|
+
readonly statusReason: S.optional<S.String>;
|
|
126
|
+
readonly coveredBy: S.optional<S.$Array<S.String>>;
|
|
127
|
+
readonly static: S.optional<S.Boolean>;
|
|
128
|
+
readonly testsCompleted: S.optional<S.Finite>;
|
|
129
|
+
readonly description: S.optional<S.String>;
|
|
57
130
|
}>, {}>;
|
|
58
131
|
|
|
132
|
+
export declare type MutantActivation = typeof MutantActivationSchema.Type;
|
|
133
|
+
|
|
134
|
+
export declare const MutantActivationSchema: S.Literals<readonly ["runtime", "static"]>;
|
|
135
|
+
|
|
136
|
+
export declare interface MutantCoverage {
|
|
137
|
+
readonly perTest: Record<string, Record<string, number>>;
|
|
138
|
+
readonly static: Record<string, number>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare type MutantEarlyResultPlan = EarlyResultPlan;
|
|
142
|
+
|
|
143
|
+
export declare interface MutantRunOptions extends RunOptions {
|
|
144
|
+
readonly testFilter?: readonly string[];
|
|
145
|
+
readonly hitLimit?: number;
|
|
146
|
+
readonly activeMutant: Mutant;
|
|
147
|
+
readonly sandboxFileName: string;
|
|
148
|
+
readonly mutantActivation: MutantActivation;
|
|
149
|
+
readonly reloadEnvironment: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare const MutantRunOptionsSchema: S.Struct<{
|
|
153
|
+
readonly timeout: S.Finite;
|
|
154
|
+
readonly disableBail: S.Boolean;
|
|
155
|
+
readonly activeMutant: typeof Mutant;
|
|
156
|
+
readonly sandboxFileName: S.String;
|
|
157
|
+
readonly mutantActivation: S.Literals<readonly ["runtime", "static"]>;
|
|
158
|
+
readonly reloadEnvironment: S.Boolean;
|
|
159
|
+
readonly testFilter: S.optionalKey<S.$Array<S.String>>;
|
|
160
|
+
readonly hitLimit: S.optionalKey<S.Finite>;
|
|
161
|
+
}>;
|
|
162
|
+
|
|
163
|
+
export declare type MutantRunPlan = RunPlan;
|
|
164
|
+
|
|
165
|
+
export declare type MutantStatus = typeof MutantStatusSchema.Type;
|
|
166
|
+
|
|
167
|
+
export declare const MutantStatusSchema: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>;
|
|
168
|
+
|
|
169
|
+
export declare type MutantTestCoverage = Mutant & {
|
|
170
|
+
readonly coveredBy: ReadonlyArray<string> | undefined;
|
|
171
|
+
readonly static: boolean | undefined;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export declare type MutantTestPlan = TestPlan;
|
|
175
|
+
|
|
176
|
+
export declare type MutateDescription = ReadonlyArray<MutationRange> | boolean;
|
|
177
|
+
|
|
178
|
+
export declare interface MutationRange {
|
|
179
|
+
readonly start: Position;
|
|
180
|
+
readonly end: Position;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export declare function normalizeFileName(fileName: string): string;
|
|
184
|
+
|
|
185
|
+
export declare type OpenEndLocation = typeof OpenEndLocationSchema.Type;
|
|
186
|
+
|
|
187
|
+
export declare const OpenEndLocationSchema: S.Struct<{
|
|
188
|
+
readonly start: S.Struct<{
|
|
189
|
+
readonly line: S.Finite;
|
|
190
|
+
readonly column: S.Finite;
|
|
191
|
+
}>;
|
|
192
|
+
readonly end: S.optional<S.Struct<{
|
|
193
|
+
readonly line: S.Finite;
|
|
194
|
+
readonly column: S.Finite;
|
|
195
|
+
}>>;
|
|
196
|
+
}>;
|
|
197
|
+
|
|
59
198
|
export declare interface ParserOptions {}
|
|
60
199
|
|
|
200
|
+
export declare type Position = typeof PositionSchema.Type;
|
|
201
|
+
|
|
202
|
+
export declare const PositionSchema: S.Struct<{
|
|
203
|
+
readonly line: S.Finite;
|
|
204
|
+
readonly column: S.Finite;
|
|
205
|
+
}>;
|
|
206
|
+
|
|
207
|
+
export declare type RunMutantResult = Mutant & {
|
|
208
|
+
readonly status: MutantStatus;
|
|
209
|
+
readonly statusReason?: string | undefined;
|
|
210
|
+
readonly testsCompleted?: number | undefined;
|
|
211
|
+
readonly killedBy?: readonly string[] | undefined;
|
|
212
|
+
readonly coveredBy?: readonly string[] | undefined;
|
|
213
|
+
readonly static?: boolean | undefined;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export declare interface RunOptions {
|
|
217
|
+
readonly timeout: number;
|
|
218
|
+
readonly disableBail: boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export declare const RunOptionsFields: {
|
|
222
|
+
timeout: S.Finite;
|
|
223
|
+
disableBail: S.Boolean;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export declare interface RunPlan {
|
|
227
|
+
readonly plan: 'Run';
|
|
228
|
+
readonly mutant: Mutant;
|
|
229
|
+
readonly runOptions: MutantRunOptions;
|
|
230
|
+
readonly netTime: number;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export declare type TestPlan = EarlyResultPlan | RunPlan;
|
|
234
|
+
|
|
61
235
|
export { }
|