> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: waitFor()

> **waitFor**\<`T`>(`callback`: () => `T` | `Promise`\<`T`>, `options?`: [`waitForOptions`](/next/api/react/testing-library/Interfaces/waitForOptions.md)): `Promise`\<`T`>

## Type Parameters

| Type Parameter |
| -------------- |
| `T`            |

## Parameters

| Parameter  | Type                                                                             |
| ---------- | -------------------------------------------------------------------------------- |
| `callback` | () => `T` \| `Promise`\<`T`>                                                     |
| `options?` | [`waitForOptions`](/next/api/react/testing-library/Interfaces/waitForOptions.md) |

## Returns

`Promise`\<`T`>
