Describe the bug
I use array().of(object({value: string})) and I use "matches" for string formatting but also applies a .test on the array to make sure string don't contain duplicates. However, sometimes, depending on the implementation of the .test on the array, the error messages from string validation will have the wrong index.
To Reproduce
I'm using yup 1.3.2 with react-hook-form 7.48.2
Create a schema with array().of(object{value: string()})
put validation on string() as well as a custom .test() on array
Expected behavior
There seems to be a bug in my .test code. Fixing the bug also fixed the issue. But I think .test is not expected to affect an inner scope validation.
Platform (please complete the following information):
Browser [e.g. chrome, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug I use array().of(object({value: string})) and I use "matches" for string formatting but also applies a .test on the array to make sure string don't contain duplicates. However, sometimes, depending on the implementation of the .test on the array, the error messages from string validation will have the wrong index.
To Reproduce
I'm using yup 1.3.2 with react-hook-form 7.48.2
Create a schema with array().of(object{value: string()})
put validation on string() as well as a custom .test() on array
Expected behavior There seems to be a bug in my .test code. Fixing the bug also fixed the issue. But I think .test is not expected to affect an inner scope validation.
Platform (please complete the following information):
Additional context Add any other context about the problem here.