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 59fc89c commit 0e799efCopy full SHA for 0e799ef
packages/convex-helpers/server/zod.test.ts
@@ -827,6 +827,10 @@ test("convexToZod complex types", () => {
827
828
const unionValidator = convexToZod(v.union(v.string(), v.number()));
829
expect(unionValidator.constructor.name).toBe("ZodUnion");
830
+ expect(unionValidator.options[0].constructor.name).toBe("ZodString");
831
+ expect(unionValidator.options[1].constructor.name).toBe("ZodNumber");
832
+ expectTypeOf(unionValidator.options[0]).toEqualTypeOf<z.ZodString>();
833
+ expectTypeOf(unionValidator.options[1]).toEqualTypeOf<z.ZodNumber>();
834
835
const literalValidator = convexToZod(v.literal("hi"));
836
expect(literalValidator.constructor.name).toBe("ZodLiteral");
0 commit comments