Skip to content

Commit

Permalink
Merge pull request #25 from piranna/patch-1
Browse files Browse the repository at this point in the history
Note about mocking Jest
  • Loading branch information
bob-carson authored Dec 14, 2017
2 parents 804ccb8 + c6278f5 commit 528b4cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ npm i react-native-mock-render --save-dev
require('react-native-mock-render/mock'); // <-- side-effects!!!
```

### Jest

Jest [doesn't support](https://github.com/Root-App/react-native-mock-render/issues/23) `require.cache`, so the correct way to do the mocking is using `jest.mock('react-native', () => require('react-native-mock-render'), {virtual: true})` in your tests setup file.

## Why?

We wanted to be able deeply render React Native components in our integration tests and already used `react-native-mock`.
Expand Down

0 comments on commit 528b4cb

Please sign in to comment.