Skip to content

Commit 0e799ef

Browse files
committed
test
1 parent 59fc89c commit 0e799ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/convex-helpers/server/zod.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ test("convexToZod complex types", () => {
827827

828828
const unionValidator = convexToZod(v.union(v.string(), v.number()));
829829
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>();
830834

831835
const literalValidator = convexToZod(v.literal("hi"));
832836
expect(literalValidator.constructor.name).toBe("ZodLiteral");

0 commit comments

Comments
 (0)