Skip to content

Commit 528ec52

Browse files
authored
React Apollo Testing (apollographql#164)
<!--**Pull Request Labels** While not necessary, you can help organize our pull requests by labeling this issue when you open it. To add a label automatically, simply [x] mark the appropriate box below: - [ ] feature - [ ] blocking - [ ] docs To add a label not listed above, simply place `/label another-label-name` on a line by itself. --> # Testing React Apollo This is a guide specifically for testing React Apollo. Based off of @excitement-engineer's (great) original work [in this PR](apollographql/apollo-client#3309). **A few notes:** - I'm keeping this separate from server testing, since combined I think they'll be too long. **I'm open to discussion on this, though**. - I added the guide here rather than React Apollo's docs, since I feel like we have a good set of `guides` here, and would hate for this to be missing. I also feel like the view logic may transfer to other UI integrations, but I don't have a lot of insight into that. - I went with using `wait(0)` instead of refactoring and counting renders like some other exmples do, for simplicity. I wanted to lower the barrier of entry for testing as much as possible. - I used `react-test-renderer` instead of Enzyme or anything else, just to keep the toolset as simple as possible.
1 parent a525a78 commit 528ec52

3 files changed

Lines changed: 398 additions & 97 deletions

File tree

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ sidebar_categories:
1818
- guides/access-control
1919
- guides/monitoring
2020
- guides/state-mgmt
21+
- guides/testing-react-components
2122
Documentation:
2223
- title: Apollo Client
2324
href: https://www.apollographql.com/docs/react/

0 commit comments

Comments
 (0)