Test an Application

Earlier in this chapter, you learned about unit and integration testing. Fully testing Elm projects requires both types of testing. Unit tests ensure that functions behave correctly in isolation. Integration tests ensure that those functions work together as expected.

So far, you’ve focused on unit testing the AwesomeDate module. In this section, you will test an Elm application that uses it. You will use a combination of unit and integration tests to test the update and view functions. Let’s get started.

First, you need the application. Outside of your awesome-date directory, create a new directory called awesome-date-app. Copy the contents of the code/test-applications/awesome-date-app directory from this book’s code ...

Get Programming Elm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.