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

Add tests for numericIdZodType utility #334

Open
miorel opened this issue Aug 17, 2024 · 0 comments
Open

Add tests for numericIdZodType utility #334

miorel opened this issue Aug 17, 2024 · 0 comments
Labels
good first issue Good for newcomers tests Improves test coverage, or other test-related improvement

Comments

@miorel
Copy link
Contributor

miorel commented Aug 17, 2024

Zod is a library for validating and parsing data. numericIdZodType is a utility we use to validate and parse numeric IDs, it accepts positive integers or the string representation of a positive integer.

This issue involves adding a file workspaces/util/src/__tests__/numericIdZodType-test.ts, for testing the numericIdZodType utility. Specifically, we care about testing the parse function, so stuff like:

expect(numericIdZodType.parse(123)).toBe(123);
expect(() => numericIdZodType.parse(-123)).toThrow(/* some error */);

To see some PRs that add tests, take a look at #288 and #290 for inspiration.

@miorel miorel added good first issue Good for newcomers tests Improves test coverage, or other test-related improvement labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tests Improves test coverage, or other test-related improvement
Projects
None yet
Development

No branches or pull requests

1 participant