Setting Up Unit Tests
Learn how to implement a test repository for testing our pure service.
We'll cover the following
Unit tests
The model tests are omitted here because they are essentially the same as in the impure section. In contrast to the tests on the impure service, we will now write unit tests for our routes.
This means that we will be able to test our routing logic without spinning up a database.
Test repository
To be able to test our routes, we will have to implement a TestRepository
first, which we will use instead of the concrete implementation that is wired to a database.
Get hands-on with 1200+ tech skills courses.