test(students): add unit, integration and e2e tests for /students (#109)
- unit: fixture shapes, mock API (GET/POST/PUT/DELETE), mock DB operations - integration: real DB CRUD via testDb (list, filter, create, get, update, delete) - e2e: handler calls directly with mock FreshContext + real DB covers auth (employee vs non-employee), 400/403/404 cases - adds test:e2e deno task and CI step - adds tests/helpers/handler.ts with makeEmployeeContext, makeContextWithAffiliation, makeGetRequest, makeJsonRequest utilities Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"test": "deno test -A --no-check tests/",
|
||||
"test:unit": "deno test -A --no-check tests/unit/",
|
||||
"test:integration": "deno test -A --no-check tests/integration/",
|
||||
"test:e2e": "deno test -A --no-check tests/e2e/",
|
||||
"migrate": "node_modules/.bin/drizzle-kit migrate"
|
||||
},
|
||||
"lint": {
|
||||
|
||||
Reference in New Issue
Block a user