Skip to content

Testing

Hunter Tratar edited this page Nov 18, 2024 · 4 revisions

Seeding

Seeds are located in the db/sql/seeds.sql file and are used when testing internal files

Test Types

Tests within /cmd/api

These tests mock external dependencies that are called OVER A NETWORK. This means that the database and the smtp server are mocked

Tests within /internal

These tests are used against a real test database using docker

Tests within /e2e

These tests use as minimal mocks as possible with the exception of the smtp server. This test builds a binary and then runs that binary within a containerized environment. It's important to note that env variables must be handled with care due to this step so make sure you add the appropriate env variable to the docker-compose file

Clone this wiki locally