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

Error thrown by string().default('foo').required().validate(undefined, {strict: true}) is not ValidationError #913

Closed
PierreJeanjacquot opened this issue May 27, 2020 · 0 comments

Comments

@PierreJeanjacquot
Copy link

Describe the bug
validate with {strict; true}) option on string schema with default() value and required() throws before validation with value undefined

To Reproduce

https://codesandbox.io/s/yupissue-string-with-default-validate-strict-rdg7j

Expected behavior

await yup.string().default('foo').required("is required").validate(undefined, {strict: true});
// should throw "ValidationError: is required"

Platform (please complete the following information):

  • Browser: Firefox for Ubuntu
  • Version 76.0.1 (64-bits)
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

No branches or pull requests

1 participant