[英]Code Coverage for browser unit tests
We are writing unit tests for library where test cases are on client side. 我们正在为库编写单元测试,其中测试用例在客户端。 And we need to see code coverage for this library. 我们需要查看该库的代码覆盖率。 We have our own custom wrapper and we are not using nodejs on server side is on python. 我们有自己的自定义包装器,并且在服务器端不使用python上的nodejs。 Is there a suitable tool for this job? 有适合这项工作的工具吗?
If you want to test a clientside javascript library karma
is a pretty good choice. 如果您想测试客户端javascript库, karma
是一个不错的选择。 It is quite easy to learn and it gives you alot of functionality: 它很容易学习,并且为您提供了许多功能:
http://karma-runner.github.io/0.13/index.html http://karma-runner.github.io/0.13/index.html
Karma got a coverage
report which gives you information about code coverage. Karma得到了一份coverage
报告,其中提供了有关代码覆盖率的信息。 Combined with Jasmine
you get a solid testing suite. 与Jasmine
结合使用,您将获得一个可靠的测试套件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.