assertk
assertk copied to clipboard
Specify failures throw AssertionError in unit tests
Unit tests could be strengthened by checking the exception type thrown by assertion failures to be AssertionError. This would avoid issues like #409 where the wrong type of exception was thrown, but unit tests were still satisfied.
This is likely as simple as replacing
assertFails { ... }
with
assertFailsWith(AssertionError::class) { ... }
but could also be extracted into a separate utility function.