Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova plugin unit testing

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!

like image 266
Shan L Avatar asked Dec 11 '14 16:12

Shan L


1 Answers

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:

  1. Defines the interface for cordova plugins to write tests
  2. 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.

like image 115
sherb Avatar answered Sep 17 '22 23:09

sherb