@moqada/react-native-mock

0.0.6 • Public • Published

react-native-mock

A fully mocked and test-friendly version of react native

How Am I Supposed To Use This?

npm i react-native-mock --save-dev
/* file-that-runs-before-all-of-my-tests.js */

// This will mutate `react-native`'s require cache with `react-native-mock`'s.
require('react-native-mock/mock'); // <-- side-effects!!! 

Why?

Testing React Native components is hard. I'm hoping this makes it easier.

I wrote a React Testing Library that works really well for React "Web", but didn't really work for React "Native" without something like this.

Wait... Is this actually a terrible idea?

I don't know. Maybe.

I'd love to figure that out though... feel free to file an issue if you have opinions.

Package Sidebar

Install

npm i @moqada/react-native-mock

Weekly Downloads

1

Version

0.0.6

License

MIT

Last publish

Collaborators

  • moqada