Files
Edu/apps/student-portal/src/mocks/server.ts
SpecialX 74474a2d04 feat(student-portal): 完整实现 student-portal 微前端
包含 src 全部实现、Dockerfile、配置文件、contracts 包等
2026-07-10 19:10:36 +08:00

21 lines
587 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* MSW 服务端 setupai14
*
* 用于 Node.js 环境Vitest 集成测试 / SSR拦截 GraphQL 请求。
* 通过 setupServer 注册 handler在测试 beforeEach 中启动、afterEach 中停止。
*
* 用法:
* import { server } from "@/mocks/server";
* beforeAll(() => server.listen());
* afterEach(() => server.resetHandlers());
* afterAll(() => server.close());
*/
import { setupServer } from "msw/node";
import { handlers } from "./handlers";
/** MSW Node.js server 单例 */
export const server = setupServer(...handlers);
export { handlers };