Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/react-testing-library/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ as these methods:
- [`result`](#result)
- [`rerender`](#rerender-1)
- [`unmount`](#unmount-1)
- [`configure`](#configure)
- [`configure` Options](#configure-options)

---

Expand Down Expand Up @@ -451,3 +453,24 @@ const {unmount} = renderHook(({name = 'Alice'} = {}) => name)

unmount()
```

## `configure`

Changes global options. Basic usage can be seen at
[Configuration Options](dom-testing-library/api-configuration.mdx).

React Testing Library also has dedicated options.

```typescript
import {configure} from '@testing-library/react'

configure({reactStrictMode: true})
```

## `configure` Options

### `reactStrictMode`

When enabled, [`<StrictMode>`](https://react.dev/reference/react/StrictMode) is
rendered around the inner element. Defaults to `false`.

2 changes: 1 addition & 1 deletion docs/react-testing-library/cheatsheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ See [Events API](dom-testing-library/api-events.mdx)
## Other

See [Querying Within Elements](dom-testing-library/api-within.mdx),
[Config API](dom-testing-library/api-configuration.mdx),
[Config API](react-testing-library/api.mdx#configure),
[Cleanup](react-testing-library/api.mdx#cleanup),

- **within** take a node and return an object with all the queries bound to the
Expand Down