alternatives
slowdep vs other approaches
Most common
setTimeout vs slowdep
The flat delay that gives false confidence vs lognormal latency that matches production. The most important comparison.
Unit testing
Jest mocks vs slowdep
jest.mock() returns instantly. slowdep adds realistic latency. They serve different purposes — here's which to use when.
HTTP mocking
MSW vs slowdep
MSW intercepts HTTP at the network level. slowdep wraps functions. They compose well together.
Network proxy
Toxiproxy vs slowdep
Toxiproxy injects network-layer chaos. slowdep wraps Node.js functions. Different scopes, complementary tools.
Production testing
Chaos engineering vs slowdep
Chaos engineering tests production. slowdep tests your code before it gets there. Shift-left resilience testing.
quick guide
When to use what
| tool | best for | requires infra |
|---|---|---|
| slowdep | Realistic latency in unit/integration tests, local dev | no |
| Jest mocks | Isolating units, controlling exact return values | no |
| MSW | Mocking HTTP responses in browser and Node tests | no |
| Toxiproxy | Network-level chaos, multi-service testing in Docker | Docker |
| Chaos engineering | Finding unknown unknowns in production systems | full prod |