-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: allow ctx.addIssue from transform #1056
feat: allow ctx.addIssue from transform #1056
Conversation
src/__tests__/transformer.test.ts
Outdated
return data.length | ||
}) | ||
.parse("asdf"); | ||
}).toThrow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better if this test could check for the kind of error, ideally the custom code/message.
Otherwise, this test would also pass if ctx
is undefined
as it would throw a JS error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Checking the whole error message now.
@FlorianWendelborn whaddya think? This a break from anyone's philosophy on zod? I'd love to wax zod philosophy |
Well, I'm in favor of this. I don't have the power to merge anything here though, just a |
Sorry for the delay on this. Fantastic PR. Landed in 3.15.0. |
* feat: allow ctx.addIssue from transform * chore: update transform test * minor: lints
Closes out part of #696 . Except only on transforms!
Will throw.
ctx
works just like in superRefine()