# JS-TOD: Detecting Order-Dependent Flaky Tests in Jest

**Authors:** Negar Hashemi, Amjed Tahir, Shawn Rasheed, August Shi, Rachel Blagojevic

arXiv: 2509.00466 · 2025-09-03

## TL;DR

JS-TOD is a tool that detects order-dependent flaky tests in Jest by systematically reordering and rerunning tests to identify inconsistencies caused by shared state or files, improving test reliability.

## Contribution

The paper introduces JS-TOD, a customizable tool for detecting test order dependency flakiness in JavaScript testing frameworks like Jest.

## Key findings

- Shared files contribute to test flakiness.
- Shared mocking state causes order-dependent failures.
- Systematic reordering reveals hidden flaky tests.

## Abstract

We present JS-TOD (JavaScript Test Order-dependency Detector), a tool that can extract, reorder, and rerun Jest tests to reveal possible order-dependent test flakiness. Test order dependency is one of the leading causes of test flakiness. Ideally, each test should operate in isolation and yield consistent results no matter the sequence in which tests are run. However, in practice, test outcomes can vary depending on their execution order. JS-TOD employed a systematic approach to randomising tests, test suites, and describe blocks. The tool is highly customisable, as one can set the number of orders and reruns required (the default setting is 10 reorder and 10 reruns for each test and test suite). Our evaluation using JS-TOD reveals two main causes of test order dependency flakiness: shared files and shared mocking state between tests.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/2509.00466/full.md

## Figures

1 figure with captions in the complete paper: https://tomesphere.com/paper/2509.00466/full.md

## References

13 references — full list in the complete paper: https://tomesphere.com/paper/2509.00466/full.md

---
Source: https://tomesphere.com/paper/2509.00466