An async test did not complete within the default 5-second timeout. The async operation may be hanging, or done() was never called.
// Instead of:
it('fetches data', (done) => {
fetchData().then(data => {
expect(data).toBeDefined();
done();
});
});
// Use:
it('fetches data', async () => {
const data = await fetchData();
expect(data).toBeDefined();
});async/await is cleaner and less error-prone than the done() callback pattern.
it('slow test', async () => {
// ...
}, 30000); // 30 second timeoutPass a timeout value as the third argument to it() or test().
jest.useFakeTimers();
it('debounces input', () => {
handleInput('test');
jest.advanceTimersByTime(500);
expect(callback).toHaveBeenCalled();
});Fake timers allow you to control time without actually waiting.
ObserveOne identifies slow and flaky tests caused by timing issues and recommends fixes.
Start Monitoring FreeA Promise was rejected but no .catch() handler or try/catch block caught the error. This can cause flaky tests or missed failures.
Jest could not resolve a module import. The file may not exist, the path may be wrong, or the module resolution config may be misconfigured.
Jest encountered syntax it cannot parse. This usually means a file needs to be transformed (e.g., TypeScript, JSX, ESM) but the transformer is not configured.
The rendered output does not match the stored snapshot. The component output changed since the snapshot was last updated.
A jest.mock() or jest.fn() is not behaving as expected — either not being called, not returning the mocked value, or not intercepting the real implementation.