Reputation: 4213
The plugin folder will have only the source files of native code. In this case, just would like to know the (best) way to unit test native part in cordova plugin? Any idea would be appreciated.
Upvotes: 1
Views: 1007
Reputation: 21
Maintain separate android project to unit test native code
Upvotes: 0
Reputation: 1512
Add an additional plugin containing Jasmine tests, which will be calling your plugin interface (i.e. JS -> plugin proxy -> Native code), and then run it with cordova-paramedic.
Example test plugin:
mkdir test
cd test
npm install cordova-paramedic
cordova-paramedic --platform windows --plugin ../your-cordova-plugin-name
You can then run tests for different platforms and even use SauceLabs for CI.
Upvotes: 1