test: add vitest, coverage and mutation gate with availability domain core

Pure logic lives in apps/web/src/domain and must stay at 100% coverage and a
100% mutation score. The first unit is the availability logic for the hero:
parsing, resolving and formatting the next free capacity block.

Vitest is pinned to 4.1.11 because @stryker-mutator/vitest-runner 10.0.0
runs zero tests per mutant under vitest 5 and reports surviving mutants.
ESLint now ignores Stryker, coverage and report output.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 18:12:47 +02:00
co-authored by Claude Sonnet 5.5
parent 43d0a49c3d
commit 0995a3b5ca
7 changed files with 14550 additions and 6122 deletions
+27
View File
@@ -0,0 +1,27 @@
import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
const root = fileURLToPath(new URL(".", import.meta.url));
export default defineConfig({
resolve: { alias: { "@": root } },
test: {
environment: "node",
include: ["src/**/*.spec.ts", "tests/unit/**/*.spec.ts"],
passWithNoTests: false,
coverage: {
provider: "v8",
// The functional core: pure logic lives in src/domain and must be fully covered.
include: ["src/domain/**/*.ts"],
exclude: ["src/domain/**/*.spec.ts"],
reporter: ["text", "json-summary", "html"],
reportsDirectory: "reports/coverage",
thresholds: {
lines: 100,
functions: 100,
branches: 100,
statements: 100,
},
},
},
});