Skip to content

Commit b0a053f

Browse files
committed
.
1 parent 7ae2c10 commit b0a053f

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

jest-setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { resetToDefaults, configure } from './src/pure';
2-
import './src/matchers/extend-expect';
32

43
beforeEach(() => {
54
resetToDefaults();

src/queries/__tests__/display-value.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '../../matchers/extend-expect';
21
import * as React from 'react';
32
import { TextInput, View } from 'react-native';
43
import { fireEvent, render, screen } from '../..';

website/docs/13.x/docs/api/jest-matchers.mdx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,7 @@ This guide describes built-in Jest matchers, we recommend using these matchers a
44

55
## Setup
66

7-
You can use the built-in matchers by adding the following line to your `jest-setup.ts` file (configured using [`setupFilesAfterEnv`](https://jestjs.io/docs/configuration#setupfilesafterenv-array)):
8-
9-
```ts title=jest-setup.ts
10-
import '@testing-library/react-native/extend-expect';
11-
```
12-
13-
Alternatively, you can add above script to your Jest configuration (usually located either in the `jest.config.js` file or in the `package.json` file under the `"jest"` key):
14-
15-
```json title=jest.config.js
16-
{
17-
"preset": "react-native",
18-
"setupFilesAfterEnv": ["@testing-library/react-native/extend-expect"]
19-
}
20-
```
7+
There is no need to setup the built-in matchers, they are automatically available in your tests when you import anything from `@testing-library/react-native`, e.g. `render`.
218

229
## Migration from legacy Jest Native matchers.
2310

0 commit comments

Comments
 (0)