Testing¶
Testing infrastructure and guides for the Microlearning Platform.
Guides¶
Integration Testing Guide¶
Comprehensive E2E testing framework covering:
- Testing philosophy and core principles (isolation, deterministic state, real infrastructure)
- Local environment setup (Supabase instance for testing)
- Test infrastructure (TestClient, fixtures, assertions)
- Writing tests and running targeted suites
- CI/CD integration
Getting a Test Token¶
How to obtain JWT tokens for testing authenticated endpoints (via Supabase Studio or helper script).
Running and Testing¶
Quick reference for all test commands and service access points.
Quick Start¶
# 1. Start local environment
deno task local:start
# 2. Reset database and seed test users
deno task local:setup
# 3. Start edge functions (separate terminal)
deno task function:serve
# 4. Run all integration tests
deno task test:e2e:all
# 5. Stop when done
deno task local:stop
Test Commands¶
| Command | Description |
|---|---|
deno task local:start |
Start local Supabase environment |
deno task local:stop |
Stop local environment |
deno task local:reset |
Reset database with migrations |
deno task local:seed |
Seed test users |
deno task local:setup |
Reset + seed (run before tests) |
deno task test:e2e:all |
Run all integration tests |
deno task test:e2e:graph |
Graph API tests only |
deno task test:e2e:content |
Content API tests only |
deno task test:e2e:user |
User API tests only |
deno task test:e2e:snapshots |
Snapshots tests only |
deno task test:e2e:protection |
Security/auth tests only |
deno task test:e2e:coverage |
Run with coverage report |
Test User Credentials¶
| Role | Password | |
|---|---|---|
| FREE | test-free@example.com | test123456 |
| PRO | test-pro@example.com | test123456 |
| PREMIUM | test-premium@example.com | test123456 |
| ADMIN | test-admin@example.com | test123456 |
Related Documentation¶
- CI/CD Guide — Automated test runs in GitHub Actions
- Authentication Guide — Auth for testing