Basic toast test library for react native with two way comms (Android only). Published on NPM https://www.npmjs.com/package/react-native-test-library-two-way-comm-damiansf
$ npm install react-native-test-library --save
$ react-native link react-native-test-library
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrarynativetoast.RNTestLibraryPackage;
to the imports at the top of the file - Add
new RNTestLibraryPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-test-library' project(':react-native-test-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-test-library/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-test-library')
import RNTestLibrary from 'react-native-test-library';
// TODO: What to do with the module?
RNTestLibrary;