Hacker News new | ask | show | jobs
by abanayev 1830 days ago
Not related to Elixir, but I disagree with the last point: you should not have test assertions inside loops at all, because it makes a test less readable and the diagnosis harder when a test fails.

You shouldn’t have to unpack complexity just to understand where a test failed or whether it failed because of bad test code or bad tested code.

Once you have so much complexity that reading and mentally executing the test takes time, you should probably be writing tests of your unit tests.

1 comments

In Elixir would it also mean that all assertions after the first failure don't get ran? Cause that's how it works in most other languages. The better (but maybe slower) alternative is parameterization.