jest-doctor
v2.0.9
Published
Custom Jest environment that detects async leaks between tests, enforces test isolation, and prevents flaky failures in CI.
Maintainers
Readme
jest-doctor
jest-doctor is a custom Jest environment that detects async leaks within tests and fails flaky tests deterministically.
Usage
Out-of-the-box jest-doctor supports node and jsdom environments. Add one of the environments to your Jest config:
export default {
testEnvironment: 'jest-doctor/env/node',
// optional
reporters: ['default', 'jest-doctor/reporter'],
};Run your tests as usual and jest-doctor will report leaks such as unresolved promises or timers.
Full documentation, configuration and more:
👉 https://stephan-dum.github.io/jest-doctor/
If jest-doctor helped you eliminate flaky tests, consider ⭐ starring the repo.
