You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thank you for this nice, lightweight library! It's a nice replacement to the heavy joi without losing the "80%" as you put it :)
I noticed an issue around number casting when using validate, while it's still working fine with validateSync.
I confirmed this by adding this small test in __tests__/numbers.js:
it('should cast strings with numbers in them to numbers (async)',async()=>{letresult=awaitv.validate(v.number().cast(),'1');isValidWithoutErrors(result);expect(result.value).toBe(1);});
It failed.
I don't know how you want to approach this, but I feel like it would be good to have some tests with validate. Probably not a duplicate of every existing synchronous tests, but a few "integration" tests with more complex payloads like this one.
The text was updated successfully, but these errors were encountered:
First off, thank you for this nice, lightweight library! It's a nice replacement to the heavy joi without losing the "80%" as you put it :)
I noticed an issue around number casting when using
validate
, while it's still working fine withvalidateSync
.I confirmed this by adding this small test in
__tests__/numbers.js
:It failed.
I don't know how you want to approach this, but I feel like it would be good to have some tests with
validate
. Probably not a duplicate of every existing synchronous tests, but a few "integration" tests with more complex payloads like this one.The text was updated successfully, but these errors were encountered: