You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -27,14 +27,14 @@ You finally want to approach testing using only best practices, while Enzyme may
27
27
28
28
## This solution
29
29
30
-
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
30
+
The React Native Testing Library is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.
31
31
32
32
This library is a replacement for [Enzyme](http://airbnb.io/enzyme/). It is tested to work with Jest, but it should work with other test runners as well.
This library has a peerDependencies listing for `react-test-renderer` and, of course, `react`. Make sure to install them too!
@@ -115,7 +115,7 @@ As you may have noticed, it's not tied to React Native at all – you can safely
115
115
116
116
## API / Usage
117
117
118
-
The [public API](https://callstack.github.io/react-native-testing-library/docs/api) of `react-native-testing-library` is focused around these essential methods:
118
+
The [public API](https://callstack.github.io/react-native-testing-library/docs/api) of `@testing-library/react-native` is focused around these essential methods:
119
119
120
120
-[`render`](https://callstack.github.io/react-native-testing-library/docs/api#render) – deeply renders given React element and returns helpers to query the output components.
121
121
-[`fireEvent`](https://callstack.github.io/react-native-testing-library/docs/api#fireevent) - invokes named event handler on the element.
Waits for non-deterministic periods of time until your element appears or times out. `waitFor` periodically calls `expectation` every `interval` milliseconds to determine whether the element appeared or not.
test('waiting for an Banana to be ready', async () => {
343
343
const { getByText } =render(<Banana />);
@@ -371,7 +371,7 @@ Waits for non-deterministic periods of time until queried element is removed or
371
371
import {
372
372
render,
373
373
waitForElementToBeRemoved,
374
-
} from'react-native-testing-library';
374
+
} from'@testing-library/react-native';
375
375
376
376
test('waiting for an Banana to be removed', async () => {
377
377
const { getByText } =render(<Banana />);
@@ -425,7 +425,7 @@ Use cases for scoped queries include:
425
425
Each of the get APIs listed in the render section above have a complimentary query API. The get APIs will throw errors if a proper node cannot be found. This is normally the desired effect. However, if you want to make an assertion that an element is not present in the hierarchy, then you can use the query API instead:
426
426
427
427
```jsx
428
-
import { render } from 'react-native-testing-library';
428
+
import { render } from '@testing-library/react-native';
429
429
430
430
const { queryByText } =render(<Form />);
431
431
constsubmitButton=queryByText('submit');
@@ -437,7 +437,7 @@ expect(submitButton).toBeNull(); // it doesn't exist
437
437
Each of the query APIs have a corresponding queryAll version that always returns an Array of matching nodes. getAll is the same but throws when the array has a length of 0.
Copy file name to clipboardExpand all lines: website/docs/GettingStarted.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,14 @@ You finally want to approach testing using only best practices, while Enzyme may
13
13
14
14
## This solution
15
15
16
-
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. It also prevents you from testing implementation details because we believe this is a very bad practice.
16
+
The React Native Testing Library is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like. It also prevents you from testing implementation details because we believe this is a very bad practice.
17
17
18
18
This library is a replacement for [Enzyme](http://airbnb.io/enzyme/).
Copy file name to clipboardExpand all lines: website/docs/Queries.md
+11-11
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Returns a `ReactTestInstance` with matching text – may be a string or regular
62
62
This method will join `<Text>` siblings to find matches, similarly to [how React Native handles these components](https://facebook.github.io/react-native/docs/text#containers). This will allow for querying for strings that will be visually rendered together, but may be semantically separate React components.
> Use sparingly and responsibly, escape hatches here
205
205
206
-
`render` from `react-native-testing-library` exposes additional queries that **should not be used in component integration testing**, but some users (like component library creators) interested in unit testing some components may find helpful.
206
+
`render` from `@testing-library/react-native` exposes additional queries that **should not be used in component integration testing**, but some users (like component library creators) interested in unit testing some components may find helpful.
207
207
208
208
<details>
209
209
<summary>Queries helpful in unit testing</summary>
0 commit comments