Files
initiative/vitest.config.ts
Lukas 2c643cc98b
All checks were successful
CI / check (push) Successful in 2m13s
CI / build-image (push) Has been skipped
Introduce adapter injection and migrate test suite
Replace direct adapter/persistence imports with context-based injection
(AdapterContext + useAdapters) so tests use in-memory implementations
instead of vi.mock. Migrate component tests from context mocking to
AllProviders with real hooks. Extract export/import logic from ActionBar
into useEncounterExportImport hook. Add bestiary-cache and
bestiary-index-adapter test suites. Raise adapter coverage thresholds
(68→80 lines, 56→62 branches).

77 test files, 891 tests, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 23:55:45 +02:00

44 lines
822 B
TypeScript

import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
include: ["packages/*/src/**/*.test.ts", "apps/*/src/**/*.test.{ts,tsx}"],
passWithNoTests: true,
coverage: {
provider: "v8",
enabled: true,
exclude: ["**/dist/**"],
thresholds: {
"packages/domain/src": {
lines: 98,
branches: 96,
},
"packages/application/src": {
lines: 96,
branches: 90,
},
"apps/web/src/adapters": {
lines: 80,
branches: 62,
},
"apps/web/src/persistence": {
lines: 85,
branches: 70,
},
"apps/web/src/hooks": {
lines: 83,
branches: 66,
},
"apps/web/src/components": {
lines: 80,
branches: 71,
},
"apps/web/src/components/ui": {
lines: 93,
branches: 90,
},
},
},
},
});