jest-doctor
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

jest-doctor

main codecov npm version License

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.

jest-doctor mascot