🔍 4. Testing
Sherlo Script
To run tests with Sherlo, add the sherlo
script to your package.json
.
Based on your builds type, select the appropriate script:
- Local Builds
- Expo Remote Builds
If you work with locally available builds, simply add the Sherlo script:
{
"scripts": {
"sherlo": "sherlo",
// ...
},
// ...
}
If you work with Expo remote builds, add the Sherlo script with the --remoteExpoBuildScript
flag, followed by the name of the remote build script:
{
"scripts": {
"sherlo": "sherlo --remoteExpoBuildScript build:remote",
// ...
},
// ...
}
Alternatively, you can use the --remoteExpo
flag, and manually initiate the builds immediately after.
Supported Flags
The sherlo
script supports the following flags:
Flag | Type | Default | Description |
---|---|---|---|
--token | <string> | undefined | project token |
--android | <path> | undefined | Android build path |
--ios | <path> | undefined | iOS build path |
--config | <path> | sherlo.config.json | config file path |
--projectRoot | <path> | . | root of the React Native project |
--remoteExpo | - | - | runs Sherlo in remote Expo mode, waiting for manual build initiation |
--remoteExpoBuildScript | <scriptName> | undefined | runs Sherlo in remote Expo mode, automatically initiating build |
Flags --token
, --android
, and --ios
replace config file properties and take priority if both are defined.
Run Tests
If you have completed the setup, prepared builds, created a config file, and added the Sherlo script, you are ready to start testing.
To run tests, execute the Sherlo script:
- npm
- yarn
- pnpm
npm run sherlo
yarn sherlo
pnpm run sherlo
Review Results
Once the tests are complete, you can review the results in the Sherlo web application.
And that's it! 🎉
Enjoy testing with Sherlo 🥳