Add MSW infrastructure: handlers, fixtures, request-log, and Vitest setup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ff03ec0ef
commit
7e052f0d36
30 files changed
+5144
No files matched your search
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Vitest global setup for MSW.
|
||||
* Starts the MSW server before all tests, resets handlers
|
||||
* and request log after each test, closes after all tests.
|
||||
*/
|
||||
import { beforeAll, afterEach, afterAll } from "vitest";
|
||||
import { server } from "@/mocks/node.js";
|
||||
import { clearRequests } from "@/mocks/request-log.js";
|
||||
|
||||
beforeAll(() => server.listen({ onUnhandledRequest: "warn" }));
|
||||
afterEach(() => {
|
||||
server.resetHandlers();
|
||||
clearRequests();
|
||||
});
|
||||
afterAll(() => server.close());
|
||||
Reference in new issue
Block a user