To give support on using MSW within Expo app(s) (managed/bare) 👀.
Currently, has one main screen in which it shows a list of random users, with possibility to refresh.
👉 We can bring it into another dimension, like to become a useful package for Expo projects 😉.
Make the server:
const server = setupServer(...handlers);
export default server;
In you App.tsx (or even index file) add the following:
import "react-native-url-polyfill/auto";
import server from "./src/devServer";
server.listen({onUnhandledRequest:"bypass"});
👉 react-native-url-polyfill/auto
is required, following this issue in msw repository.
- Clone the repo using Git command:
https://github.com/firas1220/expo-msw.git
- Install dependencies with
yarn
yarn install
or with npm
:
npm install
- Run the app using Expo command:
expo start
We appreciate any good suggestions to make this project community-driven, so it becomes useful and powerful.
Especially for:
- Getting a lightweight local dev-server for mobile/web.
- Build integration tests with Jest and RN testing library
- Expand the showcase with more examples :
NOTE: If we get more examples, then we can turn this app into a real showcase with menus and categories and more 😎.
We still at the beginning 🥺! So we need some time to see if this repo is really important to others 😅.
By the way, feel free to send your pull request, if you'd like to add some features or fix an issue.
Thank you ! 🙌