Skip to content

Commit 66a49f7

Browse files
committed
Merge branch 'master' into pr/async-utils
2 parents 59182d8 + 6cb2832 commit 66a49f7

15 files changed

+724
-525
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ merge of your pull request!
3232

3333
<!--
3434
To check an item, place an "x" in the box like so: "- [x] Documentation"
35-
Remove any items that are relevant to your changes
35+
Remove items that are irrelevant to your changes.
3636
-->
3737

3838
- [ ] Documentation updated

CONTRIBUTING.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Thanks for wanting to make contribution and wanting to improve this library for everyone!
3+
Thanks for wanting to make a contribution and wanting to improve this library for everyone!
44

55
## Project setup
66

@@ -29,12 +29,11 @@ Please make sure to run the tests before you commit your changes. You can do so
2929

3030
### Update Typings
3131

32-
The TypeScript type definitions are in the
33-
[DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react-hooks)
32+
The TypeScript type definitions can be found in the [DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react-hooks).
3433

3534
## Help needed
3635

37-
Please checkout the
38-
[the open issues](https://github.com/testing-library/react-hooks-testing-library/issues)
36+
Please check out the
37+
[the open issues](https://github.com/testing-library/react-hooks-testing-library/issues).
3938

4039
Also, please watch the repo and respond to questions/bug reports/feature requests! Thanks!

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
[![downloads](https://img.shields.io/npm/dm/@testing-library/react-hooks.svg?style=flat-square)](http://www.npmtrends.com/@testing-library/react-hooks)
2828
[![MIT License](https://img.shields.io/npm/l/@testing-library/react-hooks.svg?style=flat-square)](https://github.com/testing-library/react-hooks-testing-library/blob/master/LICENSE.md)
2929

30-
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
30+
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors)
3131
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3232
[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](https://github.com/testing-library/react-hooks-testing-library/blob/master/CODE_OF_CONDUCT.md)
3333
[![Netlify Status](https://api.netlify.com/api/v1/badges/9a8f27a5-df38-4910-a248-4908b1ba29a7/deploy-status)](https://app.netlify.com/sites/react-hooks-testing-library/deploys)

docs/api-reference.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function renderHook(
2525
Renders a test component that will call the provided `callback`, including any hooks it calls, every
2626
time it renders.
2727

28-
The `renderHook` function accept the following arguments:
28+
The `renderHook` function accepts the following arguments:
2929

3030
### `callback`
3131

@@ -55,7 +55,7 @@ providers from `React.createContext` for the hook to access with `useContext`.
5555

5656
## `renderHook` Result
5757

58-
The `renderHook` method returns an object that has a following properties:
58+
The `renderHook` function returns an object that has the following properties:
5959

6060
### `result`
6161

@@ -76,8 +76,7 @@ function rerender(newProps?: any): void
7676
```
7777

7878
A function to rerender the test component, causing any hooks to be recalculated. If `newProps` are
79-
passed, the will replace the `initialProps` passed to the `callback` function for the rerender any
80-
subsequent renders.
79+
passed, they will replace the `callback` function's `initialProps` for subsequent rerenders.
8180

8281
### `unmount`
8382

@@ -91,7 +90,7 @@ A function to unmount the test component. This is commonly used to trigger clean
9190
### `...asyncUtils`
9291

9392
Utilities to assist with testing asynchronous behaviour. See the
94-
[Async Utils](/reference/api#async-utils) section for more details.
93+
[Async Utils](/reference/api#async-utilities) section for more details.
9594

9695
---
9796

@@ -134,8 +133,16 @@ module.exports = {
134133
}
135134
```
136135
137-
Alternatively, setting the `RHTL_SKIP_AUTO_CLEANUP` environment variable to `true` before importing
138-
`@testing-library/react-hooks` will also disable this feature.
136+
Alternatively, you can change your test to import from `@testing-library/react-hooks/pure` instead
137+
of the regular imports.
138+
139+
```diff
140+
- import { renderHook, cleanup, act } from '@testing-library/react-hooks'
141+
+ import { renderHook, cleanup, act } from '@testing-library/react-hooks/pure'
142+
```
143+
144+
If neither of these approaches are suitable, setting the `RHTL_SKIP_AUTO_CLEANUP` environment
145+
variable to `true` before importing `@testing-library/react-hooks` will also disable this feature.
139146
140147
---
141148

docs/introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ the results.
5353

5454
### When not to use this library
5555

56-
1. Your hook is defined along side a component and is only used there
56+
1. Your hook is defined alongside a component and is only used there
5757
2. Your hook is easy to test by just testing the components using it
5858

5959
## Installation
@@ -83,5 +83,5 @@ npm install --save-dev react-test-renderer@^16.9.0
8383
## Testing Framework
8484

8585
In order to run tests, you will probably want to be using a test framework. If you have not already
86-
got one, we recommend using [jest](https://jestjs.io/), but this library should work without issues
86+
got one, we recommend using [Jest](https://jestjs.io/), but this library should work without issues
8787
with any of the alternatives.

other/ram.png

-1.16 KB
Loading

0 commit comments

Comments
 (0)