feat: add testing infrastructure — Vitest, Playwright, CI, git hooks
Add comprehensive testing covering 420 unit/handler tests across 24 Vitest files, 9 Playwright E2E specs, accessibility scans, and visual regression. Includes GitHub Actions CI, Husky pre-push hook, and TESTING.md docs.
This commit is contained in:
parent
036af95e00
commit
1e30ba23cd
35 changed files with 3637 additions and 5 deletions
|
|
@ -11,7 +11,8 @@ import {
|
|||
defineEventHandler,
|
||||
readBody,
|
||||
getQuery,
|
||||
getRouterParam
|
||||
getRouterParam,
|
||||
sendRedirect
|
||||
} from 'h3'
|
||||
|
||||
// Register real h3 functions as globals so server code that relies on
|
||||
|
|
@ -28,7 +29,14 @@ vi.stubGlobal('defineEventHandler', defineEventHandler)
|
|||
vi.stubGlobal('readBody', readBody)
|
||||
vi.stubGlobal('getQuery', getQuery)
|
||||
vi.stubGlobal('getRouterParam', getRouterParam)
|
||||
vi.stubGlobal('sendRedirect', sendRedirect)
|
||||
|
||||
vi.stubGlobal('useRuntimeConfig', () => ({
|
||||
jwtSecret: 'test-jwt-secret'
|
||||
jwtSecret: 'test-jwt-secret',
|
||||
helcimApiToken: 'test-helcim-token'
|
||||
}))
|
||||
|
||||
// Stubs for Nitro auto-imported server/utils (used by handlers that don't explicitly import them)
|
||||
vi.stubGlobal('requireAuth', vi.fn())
|
||||
vi.stubGlobal('requireAdmin', vi.fn())
|
||||
vi.stubGlobal('validateBody', vi.fn(async (event) => readBody(event)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue