Testing Against Real External Dependencies
Understand how to test Elixir applications against real external dependencies such as databases and third-party APIs. Learn to balance test suite speed with reliability by integrating live systems and maintaining clean test states for accurate results.
We'll cover the following...
We'll cover the following...
Many applications interact with databases, other services, or third-party APIs. This makes integration testing harder since we have to deal with other running systems to design and run our integration test suite.
There are two main approaches to dealing with an external dependency in tests:
- Use the real dependency
- Replace the real dependency with something that doubles as the dependency
Testing using the real dependency
Say a database backs up our application. The database is a dependency that’s external to the application since it’s not running inside ...