Flaky tests are a unfortunate reality of e2e and integration tests. Tests can become flaky for large variety of reasons. Just to name a few:
- Race-conditions
- Test timeouts
- Test interdependencies
- Network timeouts
While there are ways to improve the reliability of test suites, such as retrying failing test, there are not many tools to help fix flaky tests. Jest Detective provides tools to better understand flaky test suites:
- Test reliability metrics
- Built-in CPU throttling of tests to investigate race-conditions and timeouts
- Test stack trace analysis to identify the differences between a pass and fail
npm install --save-dev jest-detective
jest is a peer-dependency of Jest Detective so you must also have jest installed if it is not already:
npm install --save-dev jest
To run tests use the test
script:
npm run test
MIT