Testing the cordova plugin

Most Cordova plugins have a folder called "tests" that houses plugin.xml and tests.js files. Can anyone shed some light on how to run them, and what is required to run? There seems to be no relevant documentation. Thanks!

+5
source share
2 answers

There is an official Cordoba library for running unit tests.

From the Root template for testing plugins on github:

The org.apache.cordova.test-framework plugin has two functions:

  • Defines an interface for cordova plugins for writing tests
  • Provides test posting to actually run these tests.

Tests are performed directly within existing cordova projects, so you can quickly switch between testing and development. You can also be sure that your test suite is testing the exact versions of the plugins and platforms for which your application is using.

Visit this page; there is a lot of information on running existing tests and using the framework for your own plugins.

+3
source

There is also a plugin called cordova-paramedic based on a cord test framework that automates manual steps such as changing config.xml : <w> cd cordova-plugin-name && npm install cordova-paramedic && node node_modules/cordova-paramedic/main.js --platform android --plugin ./ --verbose

0
source

Source: https://habr.com/ru/post/1208828/


All Articles