Testing Strategy
How we test the frontend, backend, and full application stack in Mithril Forge.
- Run
just checkbefore committing. It verifies types, runs the linter, and executes unit tests.
Frontend
Section titled “Frontend”- Runner: Bun.
- Location: Co-located with components (e.g.,
InitiativeList.test.tsxnext toInitiativeList.tsx). - Scope: Isolated React components, utils, and hooks.
- Command:
just test.
Backend
Section titled “Backend”- Tools: Spring Boot testing with Testcontainers.
- Database: Real PostgreSQL instance via Testcontainers, not H2.
- Migrations: Flyway applies schema changes before tests. Never modify the schema manually.
End-to-end (E2E)
Section titled “End-to-end (E2E)”- Runner: Playwright.
- Goal: Verifies frontend and backend integration.
- Key test: Playwright opens multiple contexts to test
localStoragesync between DM and Player views. - Command:
just test-e2e.