mirror of
https://github.com/vernu/textbee.git
synced 2026-07-31 01:17:52 -04:00
Establish the testing safety net for the web dashboard before refactoring. - Vitest + React Testing Library + jsdom for unit/component tests - MSW node server mocks the API; unhandled requests throw so tests can never reach a real backend - Playwright e2e boots the real Next app but intercepts every /api/v1 call with shared fixtures, and mints a NextAuth session cookie to run authed - Shared fixtures in test/fixtures.ts back both layers - Seed tests: Button unit tests, MSW sanity checks, and a dashboard e2e happy path plus an auth-guard redirect Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8 lines
298 B
TypeScript
8 lines
298 B
TypeScript
import { setupServer } from 'msw/node'
|
|
import { handlers } from './handlers'
|
|
|
|
// Single MSW server for all unit/component tests. Any request that is NOT
|
|
// matched by a handler throws, which enforces the rule that tests never reach
|
|
// a real backend.
|
|
export const server = setupServer(...handlers)
|