This project is using Expo managed workflow.
Before starting the project, you have to install all the required packages:
yarn
After the installation you can start the Metro bundler running:
yarn start
then press i
or a
to launch the app on iOS or Android simulator/emulator or connected devices.
Test are written using Jest and React Native Testing Library.
To run tests you can run:
yarn test
If you prefer watch mode, you can run:
yarn test:watch
To generate coverage run
yarn testFinal
Storybook is a useful tool to build components in a bottom-up Component-Driven Development way. At the end, you come with a complete showcase of common components to share with team and designers. Furthermore, you can generate automatic jest snapshots from stories.
Anyway, to start Storybook, few manual configurations and steps are required:
- if started, stop the metro bundler with
ctrl-c
- create a
.env
file in project root folder following the.env.example
, but setSTART_STORYBOOK=true
if you want to start Storybook - (optional) start the storybook server running
yarn storybook
- new web page should be opened on the web browser, showing Storybook intro, but still in loading mode, waiting for mobile to be started - now restart the metro bundler and devices/simulator/emulator
yarn start
(alternative commands areyarn android
oryarn ios
)
Once the application is started on mobile, you are going to see the storybook showcase instead of the real app: you can now explore the navigation menu and view components in various states.
To switch back to actual app, follow these steps:
- stop metro bundler
ctrl-c
- stop storybook server (if started)
ctrl-c
- in file
.env
setSTART_STORYBOOK=false
- restart metro bundler
yarn start
I'm so sorry, but I could not resist to make a pun with "Rick and Morty"... An awful pun, in this particular case.