Test Doubles: Mocks, Stubs, Spies & Dependency Injection
Isolate network HTTP calls and database IO using Dummy, Stub, Mock, and Spy test doubles in Vitest/Jest.
Test Double Taxonomy
### Types of Test Doubles (Gerard Meszaros Taxonomy)
- **Dummy**: Unused placeholder objects passed strictly to satisfy parameter signatures.
- **Stub**: Provides hardcoded canned responses to method calls during the test.
- **Spy**: Wraps real functions, recording execution counts and received argument details.
- **Mock**: Pre-programmed object specifying expected call sequences and verifying assertions automatically.