Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note about mocking Jest #25

Merged
merged 2 commits into from
Dec 14, 2017
Merged

Note about mocking Jest #25

merged 2 commits into from
Dec 14, 2017

Conversation

piranna
Copy link
Contributor

@piranna piranna commented Nov 28, 2017

No description provided.

Copy link
Contributor

@bob-carson bob-carson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two little grammar fixes then we can merge this :shipit: Thanks for contributing @piranna!

README.md Outdated
@@ -19,6 +19,10 @@ npm i react-native-mock-render --save-dev
require('react-native-mock-render/mock'); // <-- side-effects!!!
```

### Jest

Jest [don'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})` at your tests setup file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change "don't support" to "doesn't support" and "at your tests setup file" to "in your test setup file"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, only I have left tests in plural because, well, it's a single setup file for several tests :-D The other spellchecks are a sympthom I'm tired :-P

@piranna piranna mentioned this pull request Nov 28, 2017
@bob-carson bob-carson merged commit 528b4cb into Root-App:master Dec 14, 2017
@piranna
Copy link
Contributor Author

piranna commented Dec 14, 2017

Thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants