fix(frontend): generate MSW mocks that satisfy their Zod schemas

This commit is contained in:
shira committed 2026-10-06 11:23:52 +03:00
1 parent ad4bb94426
commit 1aa505c743
18 files changed
+1439 -133

No files matched your search

+5
View File
@@ -85,6 +85,11 @@ function project(inputTarget: string, endpoints: string, schemas: string): Optio
generators: [{ type: "msw" }],
},
override: {
// With Zod schemas, the default enum mode makes the MSW mocks pick
// from `Object.values(<zod.enum>)`, which yields Zod internals rather
// than the enum values. The union mode inlines the literal values in
// the mocks; the Zod schemas and the types do not change.
enumGenerationType: "union",
mutator: {
path: "../src/shared/api/client.ts",
name: "apiRequest",