JS Code coverage

旧时模样 提交于 2020-01-04 15:25:27

问题


I am a newbie for the testing scenario. I have one question wanna ask your help.

For example, if I have one web application which implemented from HTML, JS and CSS and calls other APIs. While this web application is being tested, how to measure "code coverage" in an HTML/JS/CSS browser application IN THE BROWSER when doing functional testing? Any Javascript plugins to see how much of the client code was running during the tests?

Thanks in advance for your suggestion.


回答1:


I'm not entirely sure what you mean by:

"code coverage"

as your question is a little hard to understand.

But I'm assuming you are referring to some form of visualizer like this one that allows you to see step by step how your code is being executed and why it behaves as it does in a given program. As to a browser plugin or tool existing for the purpose you outline I am not aware of one that can achieve what it is I think you want. That being said, the way you phrased your question is a little strange and some clarification would go a long way to help me or someone else better answer your question.

On the other more likely hand, you refer to the actual concept of code coverage, a percentage that refers to more or less the amount of code run when tests are being run (Franci Penov does a much better job explaining here). Google Chrome does CSS and JS code coverage in-browser (at least according to these release notes)

This is a link for a Javascript code coverage testing tool

I hope my very shaky understanding of this issue helps!



来源:https://stackoverflow.com/questions/48533900/js-code-coverage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!