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

Error handling improvements #25

Merged
merged 4 commits into from
Dec 22, 2023
Merged

Error handling improvements #25

merged 4 commits into from
Dec 22, 2023

Conversation

Somtom
Copy link
Collaborator

@Somtom Somtom commented Dec 22, 2023

Problem

Often when creating first SQLMock tests, the tests tend to fail because of wrong setup reasons.
We forget to mock a specific table reference or we gave some wrong input values.
Currently, it is hard to debug for new users and we should improve this

What changed

This commit adds improved error handling that also make debugging easier:

  1. We validate provided input mocks for completeness (i.e. are all table references mocked)
  2. We validate provided input mocks to be correct (i.e. actually present in the query and not duplicated)
  3. We print the last query if a test failed. This can also help debugging what went wrong

@Somtom Somtom merged commit f66953e into main Dec 22, 2023
3 checks passed
@Somtom Somtom deleted the error-handling-improvements branch December 22, 2023 07:09
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.

1 participant