File tree Expand file tree Collapse file tree 5 files changed +12
-14
lines changed Expand file tree Collapse file tree 5 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ merge of your pull request!
33
33
34
34
<!--
35
35
To check an item, place an "x" in the box like so: "- [x] Documentation"
36
- Remove any items that are relevant to your changes
36
+ Remove items that are irrelevant to your changes.
37
37
-->
38
38
39
39
- [ ] Documentation updated
Original file line number Diff line number Diff line change 1
1
# Contributing
2
2
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!
4
4
5
5
## Project setup
6
6
@@ -29,12 +29,11 @@ Please make sure to run the tests before you commit your changes. You can do so
29
29
30
30
### Update Typings
31
31
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 ) .
34
33
35
34
## Help needed
36
35
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 ) .
39
38
40
39
Also, please watch the repo and respond to questions/bug reports/feature requests! Thanks!
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function renderHook(
25
25
Renders a test component that will call the provided `callback`, including any hooks it calls, every
26
26
time it renders.
27
27
28
- The `renderHook` function accept the following arguments:
28
+ The `renderHook` function accepts the following arguments:
29
29
30
30
### `callback`
31
31
@@ -55,7 +55,7 @@ providers from `React.createContext` for the hook to access with `useContext`.
55
55
56
56
## `renderHook` Result
57
57
58
- The `renderHook` method returns an object that has a following properties:
58
+ The `renderHook` function returns an object that has the following properties:
59
59
60
60
### `result`
61
61
@@ -76,7 +76,7 @@ function waitForNextUpdate(): Promise<void>
76
76
```
77
77
78
78
- `waitForNextUpdate` (`function`) - returns a `Promise` that resolves the next time the hook
79
- renders, commonly when state is updated as the result of a asynchronous action
79
+ renders, commonly when state is updated as the result of an asynchronous action.
80
80
81
81
### `rerender`
82
82
@@ -85,8 +85,7 @@ function rerender(newProps?: any): void
85
85
```
86
86
87
87
A function to rerender the test component, causing any hooks to be recalculated. If `newProps` are
88
- passed, the will replace the `initialProps` passed to the `callback` function for the rerender any
89
- subsequent renders.
88
+ passed, they will replace the `callback` function's `initialProps` for subsequent rerenders.
90
89
91
90
### `unmount`
92
91
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ the results.
53
53
54
54
### When not to use this library
55
55
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
57
57
2 . Your hook is easy to test by just testing the components using it
58
58
59
59
## Installation
@@ -83,5 +83,5 @@ npm install --save-dev react-test-renderer@^16.9.0
83
83
## Testing Framework
84
84
85
85
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
87
87
with any of the alternatives.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { useEffect } from 'react'
2
2
import { renderHook } from 'src'
3
3
4
4
// This verifies that by importing RHTL in an
5
- // environment which supports afterEach (like jest )
5
+ // environment which supports afterEach (like Jest )
6
6
// we'll get automatic cleanup between tests.
7
7
describe ( 'auto cleanup tests' , ( ) => {
8
8
let cleanupCalled = false
You can’t perform that action at this time.
0 commit comments