@mutineerjs/mutineer 0.5.1 → 0.7.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/README.md +42 -2
- package/dist/bin/__tests__/mutineer.spec.d.ts +1 -0
- package/dist/bin/__tests__/mutineer.spec.js +43 -0
- package/dist/bin/mutineer.d.ts +2 -1
- package/dist/bin/mutineer.js +44 -1
- package/dist/mutators/__tests__/operator.spec.js +97 -1
- package/dist/mutators/__tests__/registry.spec.js +8 -0
- package/dist/mutators/operator.d.ts +8 -0
- package/dist/mutators/operator.js +58 -1
- package/dist/mutators/registry.js +9 -1
- package/dist/mutators/utils.d.ts +2 -0
- package/dist/mutators/utils.js +58 -1
- package/dist/runner/__tests__/args.spec.js +101 -1
- package/dist/runner/__tests__/cache.spec.js +65 -8
- package/dist/runner/__tests__/changed.spec.js +85 -2
- package/dist/runner/__tests__/cleanup.spec.js +30 -0
- package/dist/runner/__tests__/config.spec.js +2 -13
- package/dist/runner/__tests__/coverage-resolver.spec.js +9 -2
- package/dist/runner/__tests__/discover.spec.js +128 -0
- package/dist/runner/__tests__/orchestrator.spec.d.ts +1 -0
- package/dist/runner/__tests__/orchestrator.spec.js +306 -0
- package/dist/runner/__tests__/pool-executor.spec.js +60 -1
- package/dist/runner/args.d.ts +18 -0
- package/dist/runner/args.js +40 -0
- package/dist/runner/cache.d.ts +19 -3
- package/dist/runner/cache.js +14 -7
- package/dist/runner/changed.js +15 -43
- package/dist/runner/cleanup.d.ts +3 -1
- package/dist/runner/cleanup.js +18 -1
- package/dist/runner/config.js +1 -1
- package/dist/runner/coverage-resolver.js +1 -1
- package/dist/runner/discover.d.ts +1 -1
- package/dist/runner/discover.js +30 -20
- package/dist/runner/jest/__tests__/pool.spec.js +41 -0
- package/dist/runner/jest/pool.js +3 -3
- package/dist/runner/orchestrator.d.ts +1 -0
- package/dist/runner/orchestrator.js +38 -9
- package/dist/runner/pool-executor.d.ts +5 -0
- package/dist/runner/pool-executor.js +15 -4
- package/dist/runner/vitest/__tests__/adapter.spec.js +60 -0
- package/dist/runner/vitest/__tests__/pool.spec.js +57 -0
- package/dist/runner/vitest/adapter.js +16 -9
- package/dist/runner/vitest/pool.js +3 -3
- package/dist/types/config.d.ts +4 -0
- package/dist/utils/__tests__/summary.spec.js +43 -1
- package/dist/utils/summary.d.ts +18 -0
- package/dist/utils/summary.js +25 -0
- package/package.json +2 -1
package/dist/utils/summary.d.ts
CHANGED
|
@@ -9,4 +9,22 @@ export interface Summary {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function computeSummary(cache: Readonly<Record<string, MutantCacheEntry>>): Summary;
|
|
11
11
|
export declare function printSummary(summary: Summary, cache?: Readonly<Record<string, MutantCacheEntry>>, durationMs?: number): void;
|
|
12
|
+
export interface JsonMutant {
|
|
13
|
+
readonly file: string;
|
|
14
|
+
readonly line: number;
|
|
15
|
+
readonly col: number;
|
|
16
|
+
readonly mutator: string;
|
|
17
|
+
readonly status: string;
|
|
18
|
+
readonly originalSnippet?: string;
|
|
19
|
+
readonly mutatedSnippet?: string;
|
|
20
|
+
readonly coveringTests?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export interface JsonReport {
|
|
23
|
+
readonly schemaVersion: 1;
|
|
24
|
+
readonly timestamp: string;
|
|
25
|
+
readonly durationMs?: number;
|
|
26
|
+
readonly summary: Summary;
|
|
27
|
+
readonly mutants: JsonMutant[];
|
|
28
|
+
}
|
|
29
|
+
export declare function buildJsonReport(summary: Summary, cache: Readonly<Record<string, MutantCacheEntry>>, durationMs?: number): JsonReport;
|
|
12
30
|
export declare function summarise(cache: Readonly<Record<string, MutantCacheEntry>>): Summary;
|
package/dist/utils/summary.js
CHANGED
|
@@ -115,6 +115,31 @@ export function printSummary(summary, cache, durationMs) {
|
|
|
115
115
|
}
|
|
116
116
|
console.log(chalk.dim(SEPARATOR) + '\n');
|
|
117
117
|
}
|
|
118
|
+
export function buildJsonReport(summary, cache, durationMs) {
|
|
119
|
+
const mutants = Object.values(cache).map((entry) => ({
|
|
120
|
+
file: entry.file,
|
|
121
|
+
line: entry.line,
|
|
122
|
+
col: entry.col,
|
|
123
|
+
mutator: entry.mutator,
|
|
124
|
+
status: entry.status,
|
|
125
|
+
...(entry.originalSnippet !== undefined && {
|
|
126
|
+
originalSnippet: entry.originalSnippet,
|
|
127
|
+
}),
|
|
128
|
+
...(entry.mutatedSnippet !== undefined && {
|
|
129
|
+
mutatedSnippet: entry.mutatedSnippet,
|
|
130
|
+
}),
|
|
131
|
+
...(entry.coveringTests !== undefined && {
|
|
132
|
+
coveringTests: entry.coveringTests,
|
|
133
|
+
}),
|
|
134
|
+
}));
|
|
135
|
+
return {
|
|
136
|
+
schemaVersion: 1,
|
|
137
|
+
timestamp: new Date().toISOString(),
|
|
138
|
+
...(durationMs !== undefined && { durationMs }),
|
|
139
|
+
summary,
|
|
140
|
+
mutants,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
118
143
|
export function summarise(cache) {
|
|
119
144
|
const s = computeSummary(cache);
|
|
120
145
|
printSummary(s, cache);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutineerjs/mutineer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A fast, targeted mutation testing framework for JavaScript and TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
101
102
|
"@commitlint/cli": "^20.4.3",
|
|
102
103
|
"@commitlint/config-conventional": "^20.4.3",
|
|
103
104
|
"@types/babel__traverse": "^7.28.0",
|