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

Handle primitive values in EnumValidationError #62

Merged
merged 1 commit into from
Sep 21, 2019

Conversation

P0lip
Copy link
Contributor

@P0lip P0lip commented Sep 20, 2019

I feel like I could organize these test fixtures slightly better, so I'm all ears if you have any idea on how to do it any better.

Moreover, I suspect we could add an extra check in findBestMatch method, but I assumed Ajv will never report an error with dataPath for non-object input.

@torifat
Copy link
Collaborator

torifat commented Sep 20, 2019

Hey, thanks for your PR and these additional test cases :)

Currently, I'm converting the whole project to TypeScript. And, it's almost done -> https://github.com/torifat/better-ajv-errors/tree/typescript

I will probably focus on organising tests after that. Feel free to share your ideas.

Personally, I don't like snapshot testing for everything but I initially did it to save time. So, my plan is to move some to them to more approachable unit tests and only use snapshot for things like CLI output or big chunk of data validation.

@torifat
Copy link
Collaborator

torifat commented Sep 20, 2019

Can you please run yarn changeset (see https://asciinema.org/a/270002) and then commit those files too. It will automatically release a new package in npm after merging in master.

@P0lip
Copy link
Contributor Author

P0lip commented Sep 21, 2019

@torifat
Done!

Currently, I'm converting the whole project to TypeScript. And, it's almost done -> https://github.com/torifat/better-ajv-errors/tree/typescript

That's great news.

Personally, I don't like snapshot testing for everything but I initially did it to save time. So, my plan is to move some to them to more approachable unit tests and only use snapshot for like like CLI output or big chunk of data validation.

I don't like snapshots either, I tend not to use them at all.
They are still great to prevent regressions, though, so it's certainly better to have snapshots than nothing.

@torifat torifat merged commit 234c01d into atlassian:master Sep 21, 2019
orgads pushed a commit to orgads/better-ajv-errors that referenced this pull request Dec 3, 2023
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

Successfully merging this pull request may close these issues.

2 participants