AntiPattern

Async Test Context Mismatch

async-test-context-mismatch

Async resources are used in the wrong lifecycle during tests—mocks return coroutines where context managers are expected, routing metadata isn’t populated yet, and version drift changes Jest internals—causing hanging, incorrect execution flow, or broken assertions.