On this page
Overview
API testing in SveltyCMS covers the REST and GraphQL endpoints, ensuring correct request handling, authentication, authorization, and data validation across all database adapters.
Test Locations
| Category | Test File(s) |
|---|---|
| API Dispatcher | tests/unit/api-request-handler/, tests/unit/hooks/api-requests.test.ts |
| API unit helpers | tests/unit/utils/mock-event.ts (invokeApi) — docs |
| Media Security | tests/unit/api/media-security.test.ts |
| Unit API suites | tests/unit/api/*.test.ts (prefer invokeApi over per-file mock events) |
| Hook Defense-in-Depth | tests/unit/hooks/defense-in-depth.test.ts |
| Setup API Routes | tests/unit/hooks/setup.test.ts |
| Black-box HTTP API | tests/integration/api/*.test.ts |
| E2E API Coverage | tests/e2e/routes/config/, tests/e2e/routes/system/ |
Note: API test coverage documentation is actively being expanded. See the Test Status dashboard, Hook Test Coverage, and E2E Coverage Matrix for route-level detail.
Related
Was this page helpful?