// Mock composition root. Imported by `mocks/node.ts`, `mocks/browser.tsx`, // and the vitest setup file — same handlers, three environments. // // In a client/BFF app, the most common pattern is intercepting fetches to // the upstream backend (proxied through `/api/backend/*`). Add those // handlers to the trailing array below. import { defineMocks, type RequestHandler } from "@raredays/mocks"; // import { http, HttpResponse } from "msw"; // CRDA:mocks-imports // Explicit annotation — TS2742 otherwise points at MSW's internal // HttpResponse-*.mjs path which isn't portable across consumer apps. export const handlers: RequestHandler[] = defineMocks( // CRDA:mocks-spread [ // App-local handlers, e.g.: // http.get("/api/backend/products", () => HttpResponse.json({ products: [] })), ], );