test: expand mutation coverage at protocol boundaries

This commit is contained in:
murashit 2026-07-18 19:10:57 +09:00
parent d3b426d500
commit 9c71b0eb88
2 changed files with 8 additions and 2 deletions

View file

@ -18,7 +18,7 @@ Use `npm run fix` for mechanical cleanup, review its diff, and run `npm run chec
Use `npm run test:coverage` to identify source modules and branches that lack exercised behavior. It reports every authored TypeScript source file, including files not imported by tests, while excluding generated app-server bindings. Open `coverage/index.html` to inspect line-level gaps. Coverage is diagnostic and has no pass/fail threshold; prioritize user-visible behavior and state-transition invariants rather than raising the aggregate percentage.
Use `npm run test:mutation` for an exploratory mutation test of the domain-owned logic under `src/domain/` and `src/features/chat/domain/`. Review surviving mutants individually instead of treating the aggregate score as a quality gate: add tests for meaningful behavior gaps, simplify equivalent or redundant code, and leave mutants alone when neither change improves the durable contract. The run ignores expensive module-initialization mutants, is intentionally manual, and writes its ignored HTML report to `reports/mutation/mutation.html`.
Use `npm run test:mutation` for an exploratory mutation test of domain-owned logic, app-server protocol normalization, thread-stream event mapping, and the chat root reducer. Review surviving mutants individually instead of treating the aggregate score as a quality gate: add tests for meaningful behavior gaps, simplify equivalent or redundant code, and leave mutants alone when neither change improves the durable contract. The run ignores expensive module-initialization mutants, is intentionally manual, and writes its ignored HTML report to `reports/mutation/mutation.html`.
## Commit Messages

View file

@ -1,7 +1,13 @@
export default {
testRunner: "vitest",
coverageAnalysis: "perTest",
mutate: ["src/domain/**/*.ts", "src/features/chat/domain/**/*.ts"],
mutate: [
"src/domain/**/*.ts",
"src/app-server/protocol/**/*.ts",
"src/features/chat/domain/**/*.ts",
"src/features/chat/app-server/mappers/thread-stream/**/*.ts",
"src/features/chat/application/state/root-reducer.ts",
],
ignoreStatic: true,
incremental: true,
reporters: ["clear-text", "progress", "html"],