End-to-end testing with Detox
Setup on Macbook
- Run
./@healthblocks-io/native/cmd/enable-detox.sh- Installs detox
- Installs applesimutils (macOS only)
- Downloads expo iOS apk
- Write tests in the ./e2e folder
Run tests
- Start expo (expo start)
- Open iOS simulator.
- Execute yarn test
Writing tests
Unit tests
These tests cover 1 function per test and don't hit API endpoints.
Consider using Jest
Consider only testing pure functions inside src/lib/
Integration tests
These tests may hit API endpoints and test if several functions collaborate together.
Consider using Jest
End-to-end test
These tests run the complete app and interact through the UI.
Consider using Detox+Jest