[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Test](https://evolu.dev/docs/api-reference/common/Test) › testWaitForMacrotask

```ts
function testWaitForMacrotask(duration?: Duration): Promise<void>;
```

Defined in: [packages/common/src/Test.ts:160](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Test.ts#L160)

Returns a Promise that resolves after a macrotask delay.

Use this to model a real async boundary in a test double, for example an
async disposer that should not complete in the same turn.

Avoid using it to coordinate assertions. Waiting for a macrotask tends to
make tests indirect and brittle.