Skip to content

Commit

Permalink
Update TutorialReact.md (#5949)
Browse files Browse the repository at this point in the history
* adds create-react-app snapshot dependency in docs

The current docs imply you can use Jest snapshots with create-react-app 'out-the-box', however the Snapshot Testing example doesn't work with a fresh install. You need to additionally install `react-test-renderer` as a dependency.

I thought it was more helpful to change the docs, but if it's better to raise the issue elsewhere let me know?!

* Update TutorialReact.md

The current docs imply you can use Jest snapshots with create-react-app 'out-the-box', however the Snapshot Testing example doesn't work with a fresh install. You need to additionally install `react-test-renderer` as a dependency.

I thought it was more helpful to change the docs, but if it's better to raise the issue elsewhere let me know?!

* ran yarn install and yarn lint:md

* amendned text to match w/o CRA code example
  • Loading branch information
atomcorp authored and rickhanlonii committed Apr 9, 2018
1 parent f6ae2cb commit 5a21be3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/TutorialReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ If you are just getting started with React, we recommend using
[Create React App](https://github.com/facebookincubator/create-react-app). It is
ready to use and
[ships with Jest](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#running-tests)!
You don't need to do any extra steps for setup, and can head straight to the
next section.
You will only need to add `react-test-renderer` for rendering snapshots.

Run

```bash
yarn add --dev react-test-renderer
```

### Setup without Create React App

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8445,7 +8445,7 @@ supports-color@^3.1.2:
dependencies:
has-flag "^1.0.0"

supports-color@^5.2.0, supports-color@^5.3.0:
supports-color@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0"
dependencies:
Expand Down

0 comments on commit 5a21be3

Please sign in to comment.