---
url: https://scruple.dev/rules/tests/no-fixed-delay-synchronization.md
description: Disallow sleeps used to synchronize tests.
---

# tests/no-fixed-delay-synchronization

Disallow sleeps used to synchronize tests.

## What it checks

Wait for a condition or use fake clocks instead of sleeps, pauses, waitForTimeout, or direct timers to guess when test work is ready.

## Rule metadata

* Package: `@scruple/tests`
* Category: Test reliability
* Tags: timing, synchronization, flakiness
* Default threshold: `plugin default`
* Minimum confidence: `plugin default`

## Examples

### Reported

```ts
await delay(500); expect(job.done).toBe(true);
```

### Accepted

```ts
await waitFor(() => expect(job.done).toBe(true));
```
