FlipCup uses a layered test strategy:
- Go tests for backend behavior
- frontend production build as a sanity check
- Playwright for end-to-end multiplayer flows
- GitHub Actions to run the same validation automatically
Run:
cd game-server
go test ./...This is the main safety net for:
- game state logic
- cleanup behavior
- API behavior
- backend regressions that do not need a browser
Run:
cd ui
npm ci
npm run buildThis is the fastest way to catch:
- broken imports
- type/build issues
- Svelte/Vite bundling problems
Run:
cd ui
npx playwright install --with-deps chromium
npm run test:e2eAdditional helpers:
cd ui
npm run test:e2e:ui
npm run test:e2e:reportThe Playwright suite is the best safety net for:
- multiplayer flows
- reconnect behavior
- screen-level regressions
- "does the app actually work from the browser?" validation
Key test locations:
ui/e2e/game.spec.tsui/e2e/disconnect.spec.tsui/e2e/game-over-scenarios.spec.ts- screenshot/spec helpers under
ui/e2e/
The main CI workflow is:
.github/workflows/ci.yml
The reusable validation workflow is:
.github/workflows/validate.yml
Those workflows run:
- Go tests
- UI dependency install
- UI build
- Playwright browser install
- Playwright end-to-end tests
That same validation pipeline is reused by staging deploys so deployment does not skip the normal checks.
Usually enough:
cd game-server
go test ./...Usually enough:
cd ui
npm run buildRun both:
cd game-server && go test ./...
cd ui && npm run build
cd ui && npm run test:e2eThe repo also keeps screenshot artifacts under docs/screenshots/. Those are more documentation/review assets than formal tests, but they are useful when you want to show UI evolution over time.