Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Double model definition #9

Closed
iceydee opened this issue Jan 20, 2022 · 1 comment
Closed

Double model definition #9

iceydee opened this issue Jan 20, 2022 · 1 comment
Assignees

Comments

@iceydee
Copy link
Collaborator

iceydee commented Jan 20, 2022

expectTypeOf(params.input).toMatchTypeOf<{
hello: string;
lengthOf: number;
}>();

Why do I need to define the input model twice? It's already in the zod part. Feels like "cake on cake".

@KATT
Copy link
Member

KATT commented Jan 22, 2022

the expectTypeOf() is only for asserting that the inference is doing what it's intended to. More clear now that I moved it to another file called .test.ts?

expectTypeOf<MyProcedure['_input_in']>().toMatchTypeOf<{
hello: string;
lengthOf?: string;
}>();
expectTypeOf<MyProcedure['_input_out']>().toMatchTypeOf<{
hello: string;
lengthOf: number;
}>();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants