Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 17ccd9e

Browse files
authoredJan 22, 2025··
chore: cleanup legacy extend-expect from code and docs (#1739)
1 parent 7ae2c10 commit 17ccd9e

26 files changed

+2
-8472
lines changed
 

‎examples/react-navigation/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎examples/react-navigation/README.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎examples/react-navigation/babel.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎examples/react-navigation/jest-setup.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎examples/react-navigation/jest.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎examples/react-navigation/package.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎examples/react-navigation/src/App.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎examples/react-navigation/src/DrawerNavigator.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎examples/react-navigation/src/DrawerNavigator.test.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎examples/react-navigation/src/NativeStackNavigator.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎examples/react-navigation/src/NativeStackNavigator.test.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎examples/react-navigation/src/StackNavigator.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎examples/react-navigation/src/StackNavigator.test.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎examples/react-navigation/src/TabNavigator.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎examples/react-navigation/src/TabNavigator.test.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎examples/react-navigation/src/screens/DetailsScreen.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎examples/react-navigation/src/screens/DetailsScreen.test.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎examples/react-navigation/src/screens/DrawerHomeScreen.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎examples/react-navigation/src/screens/HomeScreen.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎examples/react-navigation/src/screens/SettingsScreen.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎examples/react-navigation/src/test-utils.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎examples/react-navigation/yarn.lock

Lines changed: 0 additions & 8028 deletions
This file was deleted.

‎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 set up 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

‎website/docs/13.x/docs/migration/jest-matchers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All of the built-in Jest matchers provided by the React Native Testing Library s
88

99
## Usage
1010

11-
You don't need to do anything to use the built-in matchers. They are automatically available when you import anything from `@testing-library/react-native`.
11+
There is no need to set up the built-in matchers; they are automatically available in your tests when you import anything from `@testing-library/react-native`, e.g., `render`.
1212

1313
### Gradual migration
1414

0 commit comments

Comments
 (0)
Please sign in to comment.