O'Reilly logo

Metaprogramming Elixir by Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Simple and Test Fast

If you’ve had experience with testing on large projects, there’s a good chance you’ve experienced a frustratingly slow test suite. If running your tests is a slow and painful process, you’re likely to stop writing tests altogether. Worse than slow tests are overly complex tests that take more work to change than the code itself. Let’s see how you can avoid these pitfalls by following a couple of common conventions.

Limit the Number of Created Modules

When you integration-test your __using__ macros, like we did in our Translator tests, you have to create a module in the test to make assertions against. This is a perfect solution, but be aware that too many modules can cause unnecessarily slow load times when running your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required