@@ -54,7 +54,7 @@ practices.</p>
54
54
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
55
55
56
56
- [ The problem] ( #the-problem )
57
- - [ This solution] ( #this -solution )
57
+ - [ The solution] ( #the -solution )
58
58
- [ Installation] ( #installation )
59
59
- [ Suppressing unnecessary warnings on React DOM 16.8] ( #suppressing-unnecessary-warnings-on-react-dom-168 )
60
60
- [ Examples] ( #examples )
@@ -83,7 +83,7 @@ maintainable in the long run so refactors of your components (changes to
83
83
implementation but not functionality) don't break your tests and slow you and
84
84
your team down.
85
85
86
- ## This solution
86
+ ## The solution
87
87
88
88
The ` React Testing Library ` is a very lightweight solution for testing React
89
89
components. It provides light utility functions on top of ` react-dom ` and
@@ -104,7 +104,7 @@ npm install --save-dev @testing-library/react
104
104
105
105
or
106
106
107
- for installation via [ yarn] ( https://classic.yarnpkg.com/en/ )
107
+ for installation via [ yarn] [ yarn ]
108
108
109
109
```
110
110
yarn add --dev @testing-library/react
@@ -132,7 +132,7 @@ the following snippet to your test configuration
132
132
133
133
``` js
134
134
// this is just a little hack to silence a warning that we'll get until we
135
- // upgrade to 16.9: https://github.com/facebook/react/pull/14853
135
+ // upgrade to 16.9. See also : https://github.com/facebook/react/pull/14853
136
136
const originalError = console .error
137
137
beforeAll (() => {
138
138
console .error = (... args ) => {
@@ -156,8 +156,8 @@ afterAll(() => {
156
156
// hidden-message.js
157
157
import React from ' react'
158
158
159
- // NOTE: React Testing Library works with React Hooks _and_ classes just as well
160
- // and your tests will be the same however you write your components.
159
+ // NOTE: React Testing Library works well with React Hooks and classes.
160
+ // Your tests will be the same regardless of how you write your components.
161
161
function HiddenMessage ({children}) {
162
162
const [showMessage , setShowMessage ] = React .useState (false )
163
163
return (
@@ -372,7 +372,7 @@ You can also find React Testing Library examples at
372
372
If you are interested in testing a custom hook, check out [React Hooks Testing
373
373
Library][react-hooks-testing-library].
374
374
375
- > NOTE it is not recommended to test single-use custom hooks in isolation from
375
+ > NOTE: it is not recommended to test single-use custom hooks in isolation from
376
376
> the components where it's being used. It's better to test the component that's
377
377
> using the hook rather than the hook itself. The ` React Hooks Testing Library`
378
378
> is intended to be used for reusable hooks/libraries.
@@ -383,7 +383,7 @@ Library][react-hooks-testing-library].
383
383
> confidence they can give you.][guiding-principle]
384
384
385
385
We try to only expose methods and utilities that encourage you to write tests
386
- that closely resemble how your react components are used.
386
+ that closely resemble how your React components are used.
387
387
388
388
Utilities are included in this project based on the following guiding
389
389
principles:
@@ -397,8 +397,8 @@ principles:
397
397
` react- dom` .
398
398
3. Utility implementations and APIs should be simple and flexible.
399
399
400
- At the end of the day, what we want is for this library to be pretty
401
- light-weight, simple, and understandable .
400
+ Most importantly, we want React Testing Library to be pretty
401
+ light-weight, simple, and easy to understand .
402
402
403
403
## Docs
404
404
@@ -407,8 +407,8 @@ light-weight, simple, and understandable.
407
407
408
408
## Issues
409
409
410
- _Looking to contribute? Look for the [Good First Issue][good-first-issue]
411
- label._
410
+ Looking to contribute? Look for the [Good First Issue][good-first-issue]
411
+ label.
412
412
413
413
### 🐛 Bugs
414
414
@@ -608,6 +608,7 @@ Contributions of any kind welcome!
608
608
<!-- prettier-ignore-start -->
609
609
610
610
[npm]: https://www.npmjs.com/
611
+ [yarn]: https://classic.yarnpkg.com
611
612
[node]: https://nodejs.org
612
613
[build-badge]: https://img.shields.io/travis/testing-library/react-testing-library.svg?style=flat-square
613
614
[build]: https://travis-ci.org/testing-library/react-testing-library
0 commit comments