Skip to content

Commit

Permalink
maint: Refactor failing tests
Browse files Browse the repository at this point in the history
When testing our custom matcher we want to ensure they also fail a test
appropiatly (e.g. you test a mock was never called, but it was indeed
called; we want to know this fails)

Previously we did write a test like a user would write the test but
instead of using `it` we use `if.fails`.

While this did work, we are unable to validate *why* the test fails. We
now don't assume failing tests but instead we wrap these in
`expect(...).toThrow`.

This should not only be easier to read but also allows us to capture the
error message to validate the test fails for the correct reason.
  • Loading branch information
stschulte committed Jan 17, 2025
1 parent 91f9dc0 commit 62b3657
Showing 1 changed file with 313 additions and 202 deletions.
Loading

0 comments on commit 62b3657

Please sign in to comment.