Issue #10 - special about testing

Every 5th issue of Elm Bits is about some specific topic. You can see the previous one about forms.

If you're planning to use a language in production then testing is one of the core requirements, and unfortunately the official guide doesn't suggest anything. This issue is all about testing in Elm.


When I just started with Elm, Beginning Elm is the best resource out there. The explanations and examples are very easy to understand and follow. This free online book has two large chapters related to simple and fuzz testing.

In application security fuzz testing is one of the core tools in your belt, and as a developer that works mainly with Python and JavaScript nowadays I haven't really stumbled upon fuzz testing. With Elm it's exactly the opposite: almost every article you read about testing mentions fuzzing in one way or another. Here's Charlie Koster giving an introduction to what it is and how to use it. And another article on the same topic from one of the Elm's core developers, Richard Feldman.

Alex Korban gives a very simple intro on how to use elm-explorations/test for testing your views.

Most of the web application talk to other services and backend via API calls. How do you test that? How do you mock server responses? Luka Mugnaini explains here how he did just that.

An interesting thought exploration on whether it would be good to do TDD in Elm. Link


elm-explorations/test is the official and supported way of testing your Elm programs. Link

zwilias/elm-coverage is an attempt to offer test coverage. Link

avh4/elm-program-test is a library that works on top of elm-explorations/test and provides a convenient API for testing Elm programs as complete units. Link


Show Comments