This app was created using react-native init
.
The directory structure is inspired by
this article.
The project was converted to TypeScript following this guide.
To combine redux with TypeScript, the setup followed https://github.com/piotrwitek/react-redux-typescript-guide.
After checking out the project follow these steps to get started with the project:
- Run
npm install
- Run the unit tests with
npm test
- Start your Android emulator
- Run the package with
npm start
- Run the app on Android emulator with
react-native run-android
- Run the app on iOS simulator with
react-native run-ios
# Start developing with the packager
npm start
# Run the app (don't forget to run the packager with npm start, first)
react-native run-ios
react-native run-android
# Run unit tests
npm test
# Put tests in watch mode
npm test -- --watch
Start the packager with npm start
before you run the app.
On iOS, running the app is pretty simple. Just run react-native run-ios
and the simulator will start automatically.
On Android, make sure that you start Android Studio and the emulator before you run the app with
react-native run-android
.
The unit tests are run using the npm test
command.
We don't have any e2e tests, yet.
For components, use snapshot tests for the bulk of your tests and work with a test last approach, i.e. once you are happy with your component's look, create a snapshot test.
For everything else, use a test first approach, especially for reducers, action creators, selectors and any kind of service class.
More details will follow as we go.
Most of the styleguie is informed by the Airbnb TSLint config.
The formatting rules are enforced by prettier. It is safe to format the code on every save operation. Follow this guide to set up the file watcher.
Make sure you have the Prettier plugin installed in your Jetbrains IDE. You can then use Cmd+Option+Shift+P to format the file according to prettier rules.