Skip to content

Commit 647d457

Browse files
committed
docs: document rule limitations
1 parent 45c2737 commit 647d457

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/rules/no-unsettled-absence-query.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ test('shows no error', async () => {
8686
});
8787
```
8888

89+
## Limitations
90+
91+
This rule uses static analysis and only inspects the immediate test function body. Some patterns may produce false positives:
92+
93+
- **Custom helpers**: the rule does not look inside helper functions called from the test body. An async helper called with `await` is recognized (the `await` itself counts as settling), but a synchronous helper that performs settling internally is not.
94+
- **Fake timers**: manually flushing time with `jest.advanceTimersByTime` / `vi.advanceTimersByTime` is not recognized as a settling expression.
95+
- **Lifecycle hooks**: settling performed in `beforeEach` / `beforeAll` is not visible from inside the test body.
96+
- **Synchronous `act()`**: only `await act(...)` counts as a settling expression; a non-awaited `act(() => ...)` is not detected.
97+
98+
When the rule misfires on a valid pattern, prefer disabling it inline with `// eslint-disable-next-line testing-library/no-unsettled-absence-query` over silencing it globally.
99+
89100
## Further Reading
90101

91102
- [Testing Library: Appearance and Disappearance guide](https://testing-library.com/docs/guide-disappearance/)

0 commit comments

Comments
 (0)