We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32f419d commit 6b6faceCopy full SHA for 6b6face
packages/convex-helpers/server/zod.test.ts
@@ -1069,3 +1069,11 @@ test("convexToZod optional values", () => {
1069
1070
expect(roundTripOptionalArray.isOptional).toBe("optional");
1071
});
1072
+
1073
+test("convexToZod union of one literal", () => {
1074
+ const unionValidator = v.union(v.literal("hello"));
1075
+ const zodUnion = convexToZod(unionValidator);
1076
+ expect(zodUnion.constructor.name).toBe("ZodUnion");
1077
+ expect(zodUnion.parse("hello")).toBe("hello");
1078
+ expect(() => zodUnion.parse("world")).toThrow();
1079
+});
0 commit comments