mutant-cafe 0.1.4 → 0.1.5
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 +2 -2
- package/dist/bin.js +439 -170
- package/dist/bin.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ npx mutant-cafe --jobs 4 # test them
|
|
|
30
30
|
|
|
31
31
|
It mutates internal functions by default, including `Effect.fn` and `Effect.fnUntraced`, object-literal arrows, service methods inside Layers, and the inner function of a curried export. Layer values and static Layer properties are targets too. Names follow their path, such as `Greeter.layer.greet`, `policy.canEdit`, and `guardFor.<inner>`. With `--exported-only`, targets must be reachable through an exported binding path: exported top-level functions, methods and functions in exported values, returned curried functions, and exported Layers with their returned service methods. Local declarations and arrows inside other function bodies are internal, even if their owner is exported. This keeps local helpers out without dropping exported object or service APIs.
|
|
32
32
|
|
|
33
|
-
Value synthesis includes branded strings and numbers, empty sets and maps, anonymous objects with cycled literal fields, and
|
|
33
|
+
Value synthesis includes branded strings and numbers, empty sets and maps, anonymous objects with cycled literal fields, and every assignable parameter as an identity replacement, named by the parameter. Boolean and literal unions with up to eight members are exhaustive, excluding an obvious original constant. Swallow mutants enumerate recoveries only for genuinely finite success types with at most four members, including both booleans. Numbers, strings, structs, Json and larger finite sets use one representative per error tag. Larger or recursive shapes have at most six synthesized representatives per function and genre, plus `undefined` when present. For `Schema.Json`, these are `null`, `""`, `0`, `false`, `[]` and `{}`. Capped tagged unions keep the original body's discriminant first, with fields emptied, then other variants in declaration order. Synthesis stops beyond depth four or 2 KiB of printed value text and records the bound. Assignable-parameter identities are separate from the literal cap. Values differing only by `as const` or redundant parentheses generate one mutant. Naked type-parameter returns get no fabricated values, but a same-typed parameter can still supply an identity mutant. Context-only generic types that cannot be named in the body are skipped with a reason. Literal leaves keep their type without making mutable arrays readonly. Generator mutants use the body's type before `Effect.fn` pipeables such as `Effect.scoped` or `Effect.map`.
|
|
34
34
|
|
|
35
35
|
Run it from the package whose tests you want to check. In a monorepo that resolves workspace packages through built output, build the package's dependencies first.
|
|
36
36
|
|
|
@@ -118,7 +118,7 @@ Mutant ids are stable within a version and may change between versions before 1.
|
|
|
118
118
|
|
|
119
119
|
Results land in `mutants.out/`: `missed.txt`, `caught.txt`, `timeout.txt`, `unviable.txt`, `untested.txt`, `unreliable.txt`, `not-mutated.txt`, a context diff and a log per mutant, and `outcomes.json`. Every result line includes the mutant id used by `diff/<id>.diff` and `logs/<id>.log`. Lines show the declared return type when available, or an abbreviated inferred type; JSON keeps full types and uses report `schemaVersion: 2`. Add `mutants.out*` to `.gitignore`. Your source tree is never edited: each mutant runs in a scratch copy. Workspace dependency links back into the copied source tree, including package self-links, point at the scratch packages rather than the originals. Mutation imports are added when the file has no usable value import for an Effect API.
|
|
120
120
|
|
|
121
|
-
`not-mutated.txt`
|
|
121
|
+
`not-mutated.txt` gives one located line per considered function or Layer value with omitted mutations: `file:line:column`, target path and reason. Layer values use their initializer location; unavailable locations print `?:?`. It reports unsupported return fields, generic returns, explicit exclusions, capped values with an omitted count, and error classes whose constructors are unavailable. A constructor failure does not suppress recoveries or defects. Callbacks in arguments and arrays have their own locations; schema and brand constants are not functions. When a return cannot be synthesized but inner functions are mutated, the reason says so. The summary includes the line count. A target that the compiler cannot analyse gets a located `analysis failed` reason without aborting the remaining targets. Faults discovered during viability checks join the same skip report rather than becoming unviable outcomes. Config and program-load failures still stop the run. With `--in-diff`, only skips from files touched by the diff are reported. An empty selection, including a zero budget or a diff outside function bodies, skips the baseline, prints the selection count and cause to stderr, and writes a report with zero run and no baseline command. An empty actionable summary says “No actionable mutants.” The baseline command prints before execution when there are selected mutants. A failed baseline still writes `outcomes.json`, including its command and output tail; TypeScript load errors print the tsconfig path and diagnostics.
|
|
122
122
|
|
|
123
123
|
An include glob that matches no source file is a usage error, including a path outside the package root. Diff paths resolve from the Git toplevel, with support for `git diff --relative`; outside Git they resolve from the working directory.
|
|
124
124
|
|