@systemfsoftware/stryker-js-vitest-runner 0.1.4 → 2.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 +86 -0
- package/dist/index.d.mts +10 -44
- package/dist/index.mjs +1059 -10900
- package/dist/stryker-setup.mjs +1 -1
- package/package.json +10 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-vitest-runner
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Three packages are renamed. `plugin-api` is now `@systemfsoftware/stryker-js`, the
|
|
8
|
+
language every plugin is written against. `mutation-run` is now
|
|
9
|
+
`@systemfsoftware/stryker-js-platform-node`, the Node host that runs a mutation
|
|
10
|
+
test. `mutation-report` is now `@systemfsoftware/stryker-js-html-reporter`.
|
|
11
|
+
Install the new names and change your imports.
|
|
12
|
+
|
|
13
|
+
Options types moved. `StrykerOptions`, `PartialStrykerOptions` and `LogLevel` are
|
|
14
|
+
imported from the `Schema` export; `Mutant`, `MutantStatus`, `Position` and
|
|
15
|
+
`Location` from the `Mutant` export. Point a config's `extends` at the language
|
|
16
|
+
package's `Schema` export.
|
|
17
|
+
|
|
18
|
+
`MutantStatus` accepts one spelling per outcome: `Killed`, `Survived`,
|
|
19
|
+
`NoCoverage`, `Timeout`, `CompileError`, `RuntimeError`, `Ignored` and `Pending`.
|
|
20
|
+
The lowercase and abbreviated forms — `killed`, `timedOut`, `noCoverage` and the
|
|
21
|
+
rest — are gone. A comparison against a removed spelling never matched the value
|
|
22
|
+
the reporter actually produced, so check any status comparison you wrote.
|
|
23
|
+
|
|
24
|
+
Statuses, plugin kinds, exit classes and AST formats are string literal unions
|
|
25
|
+
rather than enums, so read them as their string values. Member access such as
|
|
26
|
+
`ExitClass.VerdictFail` no longer resolves.
|
|
27
|
+
|
|
28
|
+
A plugin no longer receives a logger, and the logger port is gone. Plugins log
|
|
29
|
+
through Effect, and the host decides where that output goes.
|
|
30
|
+
|
|
31
|
+
The bundled base preset is gone. A config inherits from the language package's
|
|
32
|
+
`Schema` export and states the thresholds, reporters and plugins it wants; you no
|
|
33
|
+
longer silently inherit a package manager, a plugin list or a break threshold.
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- Machine-readable mutation progress is a newline-delimited JSON file next to the HTML and JSON reports, not the console.
|
|
38
|
+
|
|
39
|
+
The console prints bounded progress prose: phase names, a count line, at most twenty surviving mutants, and a verdict. Killed mutants now advance that count. Child test runs during mutation no longer print per-test output or GitHub workflow commands.
|
|
40
|
+
|
|
41
|
+
If you parsed the console as JSON lines, read the stream file instead. A hard kill can leave that file without a closing verdict line.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- A mutation run writes the JSON report the `json` reporter is configured to produce.
|
|
46
|
+
|
|
47
|
+
Vitest no longer reprints its full summary for every mutant.
|
|
48
|
+
|
|
49
|
+
- Updated dependencies:
|
|
50
|
+
- @systemfsoftware/effect-cell-types@5.0.0
|
|
51
|
+
|
|
52
|
+
## 1.0.0
|
|
53
|
+
|
|
54
|
+
### Major Changes
|
|
55
|
+
|
|
56
|
+
- effect is now a required peer dependency. Install it alongside these packages. They previously bundled their own copy, which meant two Effect instances in one process and services that could not find each other across the boundary.
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- The Vitest runner accepts `setupFilePath`, naming the setup file it copies into
|
|
61
|
+
the sandbox. It defaults to the file shipped beside the runner's own module,
|
|
62
|
+
which is the right answer for an installed package; supply it only when you are
|
|
63
|
+
running the runner from sources rather than from an install.
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- The shared helpers package is gone. Nothing installs it any more, and the
|
|
68
|
+
handful of helpers worth sharing now live in the plugin contract next to the
|
|
69
|
+
types they serve:
|
|
70
|
+
|
|
71
|
+
- `strykerReportBugUrl`, `normalizeFileName`, `propertyPath`, `errorToString`
|
|
72
|
+
and `isErrnoException` from `@systemfsoftware/stryker-js-plugin-api/core`
|
|
73
|
+
- `noopLogger` from `@systemfsoftware/stryker-js-plugin-api/logging`
|
|
74
|
+
- `testFilesProvided` from `@systemfsoftware/stryker-js-plugin-api/test-runner`
|
|
75
|
+
|
|
76
|
+
If you imported any of those, change the specifier. Everything else it exported
|
|
77
|
+
had no consumer and is removed: use `Predicate.isNotNullish` from Effect in place
|
|
78
|
+
of `notEmpty`, and `RegExp.escape` in place of `escapeRegExp`.
|
|
79
|
+
|
|
80
|
+
- These packages no longer install dependencies they never imported, so installing them pulls less into your tree.
|
|
81
|
+
|
|
82
|
+
`tslib` is gone from all six. The mutation runner additionally stops installing `lodash.groupby`, `semver` and `source-map`, and the command line interface stops installing `@effect/platform-node-shared`. Nothing exported changes.
|
|
83
|
+
|
|
84
|
+
- Published packages no longer carry build artifacts left over from earlier builds. One package was shipping about a megabyte of bundled test-runner internals this way.
|
|
85
|
+
|
|
86
|
+
- Updated dependencies:
|
|
87
|
+
- @systemfsoftware/stryker-js-plugin-api@3.0.0
|
|
88
|
+
|
|
3
89
|
## 0.1.4
|
|
4
90
|
|
|
5
91
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,52 +1,18 @@
|
|
|
1
|
-
import { Injector, PluginKind, SandboxPluginContext } from "@systemfsoftware/stryker-js-plugin-api/plugin";
|
|
2
|
-
import { INSTRUMENTER_CONSTANTS, StrykerOptions } from "@systemfsoftware/stryker-js-plugin-api/core";
|
|
3
|
-
import { DryRunOptions, DryRunResult, MutantRunOptions, MutantRunResult, TestRunner, TestRunnerCapabilities } from "@systemfsoftware/stryker-js-plugin-api/test-runner";
|
|
4
|
-
import { createVitest } from "vitest/node";
|
|
5
|
-
import { Logger } from "@systemfsoftware/stryker-js-plugin-api/logging";
|
|
6
|
-
//#region src/vitest-wrapper.d.ts
|
|
7
|
-
interface ResolvedVitest {
|
|
8
|
-
createVitest: typeof createVitest;
|
|
9
|
-
version: string;
|
|
10
|
-
}
|
|
11
|
-
type VitestResolver = (dir: string) => Promise<ResolvedVitest>;
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/vitest-test-runner.d.ts
|
|
14
|
-
type StrykerNamespace = '__stryker__' | '__stryker2__';
|
|
15
|
-
declare class VitestTestRunner implements TestRunner {
|
|
16
|
-
private readonly log;
|
|
17
|
-
private globalNamespace;
|
|
18
|
-
private readonly sandboxDirectory;
|
|
19
|
-
private readonly resolveVitestFor;
|
|
20
|
-
static inject: readonly ["options", "logger", 'globalNamespace', "sandboxDirectory"];
|
|
21
|
-
private ctx?;
|
|
22
|
-
private readonly options;
|
|
23
|
-
private localSetupFile?;
|
|
24
|
-
constructor(options: StrykerOptions, log: Logger, globalNamespace: StrykerNamespace, sandboxDirectory: string, resolveVitestFor?: VitestResolver);
|
|
25
|
-
capabilities(): TestRunnerCapabilities;
|
|
26
|
-
init(): Promise<void>;
|
|
27
|
-
dryRun(options: DryRunOptions): Promise<DryRunResult>;
|
|
28
|
-
mutantRun(options: MutantRunOptions): Promise<MutantRunResult>;
|
|
29
|
-
private run;
|
|
30
|
-
private setEnv;
|
|
31
|
-
private requireCtx;
|
|
32
|
-
private resetContext;
|
|
33
|
-
private readHitCount;
|
|
34
|
-
private readMutantCoverage;
|
|
35
|
-
dispose(): Promise<void>;
|
|
36
|
-
}
|
|
37
|
-
declare function createVitestTestRunnerFactory(namespace?: typeof INSTRUMENTER_CONSTANTS.NAMESPACE | '__stryker2__'): {
|
|
38
|
-
(injector: Injector<SandboxPluginContext>): VitestTestRunner;
|
|
39
|
-
inject: ['$injector'];
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
1
|
//#region src/index.d.ts
|
|
43
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The `vitest` test runner, as the plugin the engine loads.
|
|
4
|
+
*
|
|
5
|
+
* The declared layer asks for the run's resolved options and the sandbox it runs
|
|
6
|
+
* in, so the requirement is visible in the type and an engine that does not
|
|
7
|
+
* provide it fails to compile.
|
|
8
|
+
*/
|
|
9
|
+
declare const strykerPlugins: import("@systemfsoftware/stryker-js/Plugin").PluginContribution<"TestRunner">[];
|
|
44
10
|
/**
|
|
45
11
|
* The `vitest` option section as a JSON Schema document, for Stryker's option
|
|
46
|
-
* validation
|
|
12
|
+
* validation — derived from the declaration, never read from a file. It is built
|
|
47
13
|
* here, at the entry that contributes it, because a document is a *use* of a
|
|
48
14
|
* schema and the schema module exports only declarations.
|
|
49
15
|
*/
|
|
50
16
|
declare const strykerValidationSchema: Record<string, unknown>;
|
|
51
17
|
//#endregion
|
|
52
|
-
export {
|
|
18
|
+
export { strykerPlugins, strykerValidationSchema };
|