Testing
In one line: Royal Glow follows a testing diamond — most tests at the
integration boundary — across 13 layers, all on free tiers at $0/month. CI
gates get stricter from
dev to prod, and Lighthouse requires performance ≥
95 with accessibility/best-practices/SEO = 100.Philosophy
Royal Glow uses a testing diamond (not the traditional pyramid) because the integration boundary is where most bugs live in a fullstack app:- Tests are production code — same quality, same review rigor, same TypeScript strictness
- Test behaviour, not implementation — if you refactor and tests break, the tests were wrong
- Deterministic or nothing — flaky tests get quarantined immediately, fixed within 24h, or deleted
- Fast feedback loop — unit tests < 10s, integration < 60s, E2E < 5 min (local)
Testing Layers
Tool Decisions
Locked-In Stack
Tools Rejected
Cypress
Cypress
Slower than Playwright, no WebKit, worse Next.js App Router support.
Jest
Jest
Vitest is a drop-in replacement, 10x faster with Bun.
Chromatic
Chromatic
Requires Storybook — RGSS doesn’t use Storybook.
Datadog
Datadog
0.
Snyk
Snyk
Trivy + Socket.dev covers the same ground for free.
Unit Testing (Vitest)
What to unit test:Integration Testing
Integration tests run against the Neontest branch — a real database with seeded fixtures. The test branch is wiped and reseeded before each CI run.
E2E Testing (Playwright)
Critical paths covered:- Homepage loads → Book Now opens dialog → 4-step booking flow → submission
- Sign in with Google → onboarding → profile complete
- Admin dashboard → approve booking → mark complete → invoice generated
- Customer views booking history → cancels upcoming booking
- Admin creates membership → customer views membership page
Accessibility Testing
- axe-core integrated into Playwright E2E tests — runs on every page
- Lighthouse CI — Accessibility score = 100 required to merge
- Keyboard navigation — booking flow completable via keyboard only
- Screen reader — manual testing with VoiceOver (macOS) before each release
Performance Testing
Lighthouse CI
k6 Load Testing
Target: 50 concurrent users on pprd. Runs on every PR topprd.
Security Testing
CI Pipeline Integration
Gates are cumulative — each stage adds checks on top of the previous one.- PR to dev
- PR to test
- PR to pprd
- PR to prod
- Lint + Format (Biome)
- Type check (tsc —noEmit)
- Unit tests (Vitest)
Coverage Requirements
Commands
Meticulous AI — Visual Regression
Meticulous records real user sessions on pprd, then replays them as visual regression tests on every PR. Zero test code required — it learns from real usage. What Meticulous catches that Playwright doesn’t:- Subtle font rendering changes
- 1px layout shifts after CSS changes
- Colour/spacing regressions in components you didn’t touch
- Responsive breakpoint issues on real device viewports