大多数 Cordova 插件都有一个名为“tests”的文件夹,其中包含 plugin.xml 和 tests.js。任何人都可以阐明如何运行它们,以及运行需要什么?似乎没有相关的文档。谢谢!

请您参考如下方法:

有一个用于运行单元测试的官方 Cordova 库。

来自 Cordova Plugin Test Framework在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.



访问该页面;那里有大量关于运行现有测试和为您自己的插件使用框架的信息。


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!