Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/zod parser tests #661

Closed
wants to merge 5 commits into from
Closed

Conversation

helt
Copy link
Contributor

@helt helt commented Nov 22, 2023

Added a few repro tests for zod code generation.

I hope the tests make sense and are okay.

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kubb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2023 9:23am

Copy link

codesandbox-ci bot commented Nov 22, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a1ae7ae:

Sandbox Source
advanced-pet-store Configuration
faker-pet-store Configuration
msw-pet-store Configuration
react-query-pet-store Configuration
react-query-v5-pet-store Configuration
typescript-pet-store Configuration
simple-single-pet-store Configuration
solid-query-pet-store Configuration
svelte-query-pet-store Configuration
swr-pet-store Configuration
vue-query-pet-store Configuration
zod-pet-store Configuration
zodios-pet-store Configuration
client-pet-store Configuration

@stijnvanhulle
Copy link
Collaborator

@helt Is this related to your issue? #658

@helt
Copy link
Contributor Author

helt commented Nov 25, 2023

@stijnvanhulle Yes. Sorry for the intermixing of issues here.

The tests document the following discoveries:

  • .nullable() is added incorrectly (E. G. In test NullableStringWithAnyOf
  • format UUID seems not to be added at all. See NullableStringUuid
  • const keyword should be translated to z.literal(...) if I understand correctly. Eg NumberValueConst test

But please note, that the expected values of the tests are merely what I think it should be, and have been written manually, and therefore might contain syntax and semantic errors!

@stijnvanhulle
Copy link
Collaborator

@helt Added your tests to #683 and also fixed the issue :)

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

Successfully merging this pull request may close these issues.

2 participants