Skip to content

Commit d3f1823

Browse files
committed
minor cleanup of #747
1 parent 4c69c79 commit d3f1823

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/recipes/react.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Setting up Babel
44

5-
The first thing you need to do is to set up `babel` to transpile JSX code from the tests by adding an AVA section to your `package.json`:
5+
The first step is setting up Babel to transpile JSX code from the tests by adding an AVA section to your package.json:
66

77
```json
88
{
@@ -15,21 +15,21 @@ The first thing you need to do is to set up `babel` to transpile JSX code from t
1515
}
1616
```
1717

18-
You can find more information about setting up `babel` with AVA in the [babelrc recipe](https://github.com/sindresorhus/ava/blob/master/docs/recipes/babelrc.md).
18+
You can find more information about setting up Babel with AVA in the [babelrc recipe](babelrc.md).
1919

2020
## Using [Enzyme](https://github.com/airbnb/enzyme)
2121

2222
Let's first see how to use AVA with one of the most popular React testing libraries: [Enzyme](https://github.com/airbnb/enzyme).
2323

24-
If you only plan to use [shallow component rendering](https://facebook.github.io/react/docs/test-utils.html#shallow-rendering), you don't need any extra setup.
24+
If you intend to only use [shallow component rendering](https://facebook.github.io/react/docs/test-utils.html#shallow-rendering), you don't need any extra setup.
2525

2626
First install [Enzyme required packages](https://github.com/airbnb/enzyme/#installation):
2727

2828
```console
2929
$ npm install --save-dev enzyme react-addons-test-utils react-dom
3030
```
3131

32-
And you can use Enzyme straight away:
32+
Then you can use Enzyme straight away:
3333

3434
```js
3535
import test from 'ava';
@@ -69,9 +69,9 @@ test('renders children when passed in', t => {
6969

7070
Enzyme also has a `mount` and `render` helper to test in an actual browser environment. If you want to use these helpers, you will have to setup a browser environment. Check out the [browser testing recipe](https://github.com/sindresorhus/ava/blob/master/docs/recipes/browser-testing.md) on how to do so.
7171

72-
To see an example of AVA working together with Enzyme, set up for browser testing, have a look at [this sample project](https://github.com/adriantoine/ava-enzyme-demo).
72+
To see an example of AVA working together with Enzyme set up for browser testing, have a look at [this sample project](https://github.com/adriantoine/ava-enzyme-demo).
7373

74-
This is a basic example about how to integrate Enzyme with AVA. For more information about using Enzyme for unit testing React component, have a look at [Enzyme's documentation](http://airbnb.io/enzyme/).
74+
This is a basic example on how to integrate Enzyme with AVA. For more information about using Enzyme for unit testing React component, have a look at [Enzyme's documentation](http://airbnb.io/enzyme/).
7575

7676
## Using JSX helpers
7777

@@ -129,15 +129,17 @@ test('renders children when passed in', t => {
129129

130130
Note that you have to use variables like `actual` and `expected` because [`power-assert` doesn't handle JSX correctly](https://github.com/power-assert-js/power-assert/issues/34).
131131

132-
This is a basic example about how to use `jsx-test-helpers` with AVA. To see a more advanced usage of this library, have a look at [this annotated test file](https://github.com/MoOx/jsx-test-helpers/blob/master/src/__tests__/index.js).
132+
This is a basic example on how to use `jsx-test-helpers` with AVA. To see a more advanced usage of this library, have a look at [this annotated test file](https://github.com/MoOx/jsx-test-helpers/blob/master/src/__tests__/index.js).
133133

134134
[This sample project](https://github.com/MoOx/jsx-test-helpers) shows a basic and minimal setup of AVA with `jsx-test-helpers`.
135135

136136
## Using other assertion libraries
137137

138-
In AVA, you can use any assertion library and there is already a few out there allowing to test React components. Here is a list of assertion libraries working well with AVA:
138+
In AVA, you can use any assertion library, and there are already a few out there to test React components. Here is a list of assertion libraries working well with AVA:
139+
139140
- [`expect-jsx`](https://github.com/algolia/expect-jsx) ([Example](https://github.com/sindresorhus/ava/issues/186#issuecomment-161317068))
140141
- [`unexpected-react`](https://github.com/bruderstein/unexpected-react) ([Sample project with an output example](https://github.com/adriantoine/ava-unexpected-react-demo))
141142

142143
## Reference
144+
143145
- [In depth guide of setting up AVA with code coverage on a React project](https://github.com/kentcdodds/react-ava-workshop)

0 commit comments

Comments
 (0)