This React Native app provides an example of how the react-native-atomic-file-ops
library can be imported and used. It also demonstrates how the library is able to successfully overwrite existing content in a file with truncated data.
See the library in use in the atomic file writing integration tests.
yarn install
For iOS:
cd ios
pod install
Start Metro.
yarn start
Start the app.
Android:
yarn android
iOS:
yarn ios
When the app is running successfully and ready to start testing, you should see the following screen:
Note: The above image is of an iPhone 13 Simulator display. The appearance of your screen may vary slightly depending on which emulator, simulator, or physical device you are using.
The AtomicFileOps example app uses Cavy to provide integration testing of the react-native-atomic-file-ops
library. Scenarios tested include:
- Overwriting an existing file with truncated JSON data
- Overwriting an existing file with truncated Base64 data
To run the tests:
Android:
cavy run-android
iOS:
cavy run-ios
Test results and output should appear in either the terminal or the console (if you are connected to the React Native debugger).