4 ms·
> Unit tests are more of a pain > …though I really have a hard time expressing why. This one is interesting, I'm new to Elixir an I really enjoy writing tests
by __jonas 3y ago
> Unit tests are more of a pain
> …though I really have a hard time expressing why.
This one is interesting, I'm new to Elixir an I really enjoy writing tests for my Elixir app, in a way I kind of never have before.
This might just be an effect of the ecosystem being built more with testing in mind than I would have expected.
For instance when I wanted to add email sending to my Phoenix App, the Swoosh library came with a Test adapter and an assertion to use in tests for it.
I would have normally expected to have to write some mock of the email library or use some testing SMTP service, but it was so surprisingly painless instead.
Same with testing functions that interact with the database in Ecto, I feel like the way to do this is well thought out as part of Ecto and I never have to work around any testing-specific issues.