Spacerr
  • Features
  • Pricing
  • FAQ
  • Docs
Get Access
Spacerr
  • Introduction
  • Features
  • Tech Stack
  • Setup
  • Configuration
  • Agents
  • Database
  • Jobs
  • Admin
  • Settings
  • Billing
  • Storage
  • Email
  • Support
  • Localization
  • SEO
  • Analytics
  • UI And Navigation
  • Deploying To Production
  • Testing And QA
  • Troubleshooting

Search documentation

Search documentation pages.

Documentation/Testing And QA

Testing And QA

Spacerr uses TypeScript, ESLint, Bun tests, Playwright, and feature owned tests to keep the product safe to extend. The goal is simple: run fast checks while building, then run full end to end checks before shipping risky changes.

The current kit includes 32 unit tests and 77 E2E tests across billing, auth, admin, blog, settings, contact, AI chat, and widget behavior.

Commands

Use these commands during development.

bash
bun run lint
bun run test:unit
bun run test:e2e
bun run test:all
bun run build

bun run lint runs TypeScript with tsc --noEmit and ESLint.

bun run test:unit runs Bun tests under src.

bun run test:e2e installs the Chromium browser if needed and runs Playwright with .env.local.

bun run test:all runs unit tests and end to end tests.

bun run build checks the production Next.js build.

Test Ownership

Tests are owned by the feature they cover.

txt
src/features/auth/tests
src/features/blog/tests
src/features/admin/tests
src/features/billing/tests
src/features/contact/tests
src/features/settings/tests
src/features/ai/chat/tests
src/features/ai/widget/tests

Shared helpers can live in root test helper folders such as e2e/helpers, but actual feature behavior tests should stay inside the owning feature.

This keeps tests easy to find when you change a feature.

Test IDs

Reusable test IDs should live in feature owned constants files.

txt
src/features/ai/chat/constants/ai-chat-test-ids.ts
src/features/auth/constants/auth-test-ids.ts

Use constants from components and tests instead of hardcoding data-testid strings in many places.

Route Helpers

Tests should use route helpers instead of duplicating route strings.

Use WebRoutes for pages and ApiRoutes for API paths.

typescript
WebRoutes.dashboard.path
WebRoutes.blog.path
ApiRoutes.billing.status

This keeps tests stable when a route changes.

End To End Tests

Playwright tests exercise real browser flows.

bash
bun run test:e2e

Use the UI runner when debugging a failing browser flow.

bash
bun run test:e2e:ui

Use debug mode when you need step by step inspection.

bash
bun run test:e2e:debug

E2E tests need .env.local because they create users, sign in, hit API routes, and sometimes touch the database or provider backed flows.

E2E tests can very rarely be flaky because they combine browser timing, mocked AI streams, persisted query cache, realtime updates, and route transitions. If one fails once, rerun it before assuming the product is broken. Playwright retries E2E failures once locally and twice in CI, so real deterministic bugs should still keep failing.

CI Recommendation

Add CI and make it run the full test command so every important check runs before changes ship.

bash
bun install
bun run lint
bun run test:all
bun run build

bun run test:all runs the unit and end to end test suites. Make sure CI has the required environment variables for the flows you want it to test.

Deploying To Production

Learn how to deploy Spacerr with production environment variables, providers, migrations, and launch checks.

Troubleshooting

Fix common local setup, provider, billing, auth, database, and deployment issues.

On this page
CommandsTest OwnershipTest IDsRoute HelpersEnd To End TestsCI Recommendation