Most of the Cordova plugins have a folder called 'tests', which hosts plugin.xml and tests.js. Can anyone shed some light on how to run them, and what is required to run? There seems no relevant documentation. Thanks!
There's an official Cordova library for running the unit tests.
From the Cordova Plugin Test Framework on github:
The
org.apache.cordova.test-framework
plugin does two things:
- Defines the interface for cordova plugins to write tests
- Provides a test harness for actually running those tests
Tests run directly inside existing cordova projects, so you can rapidly switch between testing and development. You can also be sure that your test suite is testing the exact versions of plugins and platforms that your app is using.
Visit that page; there's plenty of information there on running existing tests and using the framework for your own plugins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With