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

Failure message override error #23

Open
jack828 opened this issue Nov 5, 2019 · 1 comment
Open

Failure message override error #23

jack828 opened this issue Nov 5, 2019 · 1 comment

Comments

@jack828
Copy link

jack828 commented Nov 5, 2019

When using createValidatorAllowingFailureMessageOverride, incorrect arguments are passed to the validateFn. A validator expects arguments like fn(key, name, object, callback), whereas createValidator provides fn(name, object, callback).

This means it is not possible to use createValidatorAllowingFailureMessageOverride with any validity modules, only with booleanToCallback.

Is there a reason for this or shall I submit a PR?

@serby
Copy link
Owner

serby commented Nov 5, 2019

If that is true, how does this test pass?

https://github.com/serby/validity/blob/master/test/validity.test.js#L119

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

2 participants