Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/realorangeone/react-native-mock
A fully mocked and test-friendly version of react native (maintainers wanted)
https://github.com/realorangeone/react-native-mock
react react-native react-native-mock testing
Last synced: 7 days ago
JSON representation
A fully mocked and test-friendly version of react native (maintainers wanted)
- Host: GitHub
- URL: https://github.com/realorangeone/react-native-mock
- Owner: RealOrangeOne
- License: mit
- Created: 2016-01-30T22:27:14.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-30T19:42:55.000Z (over 5 years ago)
- Last Synced: 2024-05-01T21:43:58.760Z (6 months ago)
- Topics: react, react-native, react-native-mock, testing
- Language: JavaScript
- Homepage:
- Size: 327 KB
- Stars: 569
- Watchers: 22
- Forks: 157
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
_Interested in helping maintain `react-native-mock`? [Reach out!](https://github.com/RealOrangeOne/react-native-mock/issues/168)_
# react-native-mock [![Build Status](https://travis-ci.org/RealOrangeOne/react-native-mock.svg?branch=master)](https://travis-ci.org/RealOrangeOne/react-native-mock)
[![Join the chat at https://gitter.im/RealOrangeOne/react-native-mock](https://badges.gitter.im/RealOrangeOne/react-native-mock.svg)](https://gitter.im/RealOrangeOne/react-native-mock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A fully mocked and test-friendly version of react native## Requirements
- Node.js 4+
- The latest version of react-native__Note__: This library is designed to work with the most recent version of react-native. If you aren't using the most recent version, you will need to download an older version of this library, as the API is likely to be different, and the dependencies are likely to break.
## How Am I Supposed To Use This?
```bash
npm i react-native-mock --save-dev
``````js
/* 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.
## Contributing
Discovered a bug, got a new feature, or found something that needs improving? __Submit a PR!__Make sure to read through the CONTRIBUTING.md file before submitting your PR!
### Core Contributors
- [Jake Howard](https://github.com/RealOrangeOne)
- [Leland Richardson](https://github.com/lelandrichardson) (Original Creator)## What do the labels mean?
See [this wiki page](https://github.com/RealOrangeOne/react-native-mock/wiki/Labels---What-do-they-mean%3F).