-
-
Notifications
You must be signed in to change notification settings - Fork 148
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: Add custom parsers testing helpers #853
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
commit: |
3118cdf
to
3963c53
Compare
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.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- packages/nuqs/package.json: Language not supported
Comments suppressed due to low confidence (3)
packages/nuqs/src/testing.ts:25
- [nitpick] The error message could be more clear and helpful. Consider rephrasing to: '[nuqs] testSerializeThenParse: The parsed value is null when parsing the serialized value ${serialized} from the input ${input}.'
[nuqs] testSerializeThenParse: parsed value is null (when parsing ${serialized} serialized from ${input})
packages/nuqs/src/testing.ts:62
- [nitpick] The error message could be more clear and helpful. Consider rephrasing to: '[nuqs] testParseThenSerialize: The parsed value is null when parsing the input ${input}.'
[nuqs] testParseThenSerialize: parsed value is null (when parsing ${input})
packages/nuqs/src/testing.ts:14
- There is a typo in the usage example. 'testSerializeThanParse' should be 'testSerializeThenParse'.
expect(() => testSerializeThanParse(myParser, 'bar')).toThrow()
3963c53
to
0872894
Compare
0872894
to
177ecb3
Compare
177ecb3
to
7064274
Compare
7064274
to
2c81c18
Compare
2c81c18
to
eba5ade
Compare
eba5ade
to
c40da19
Compare
c40da19
to
bf519bf
Compare
bf519bf
to
e1d827e
Compare
d89e57b
to
64f6635
Compare
🎉 This PR is included in version 2.4.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR introduces a new export, with two functions to help testing custom parsers.
Parsers must be bijective, which means:
For that second point, identical value means that the
eq
equality function of the parser should return true when fed the input and output.Usage
Eg, in Vitest:
Bug fix
Also contains a bug fix for date parsers which were missing a suitable equality function.
Tasks