Skip to content
Testing·Intermediate·Conceptual·1 min read

Why can testing with real timers make a debounce test slow across a large suite?

Short interview answer

Each test would need to actually wait out the real debounce delay, and those delays accumulate across many tests; fake timers let the same assertions run in milliseconds regardless of the configured delay.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Mocking, test doubles, and async tests

Related questions