PitchHut logo
jest-doctor
Prevent flaky test failures with async leak detection in Jest.
Pitch

jest-doctor provides a custom Jest environment designed to detect async leaks and fails flaky tests deterministically. It enforces strong test isolation and hygiene by checking for unresolved promises, open timers, and other side effects at test boundaries. Enhance testing accuracy and streamline your project workflows with this valuable tool.

Description

About

jest-doctor is a custom jest environment that addresses asynchronous leaks. It is designed to enhance test reliability by preventing flaky test failures, enabling developers to maintain a cleaner and more stable testing environment.

It detects and reports when tests:

  • Leave unresolved promises
  • Leave open real or fake timers
  • Leave DOM listeners attached
  • Rely on excessive real-time delays
  • Produce unexpected console or process output

For comprehensive documentation and detailed usage instructions, please visit the official documentation site: jest-doctor Documentation.

If jest-doctor helped you eliminate flaky tests, consider ⭐ starring the repo — it helps others discover the project and motivates continued development.

There is also a feature request to integrate parts of the environment in jest itself.

0 comments

No comments yet.

Sign in to be the first to comment.