开发者

javascript unit testing : how do you keep track of all the tests you have written and what code coverage you have?

开发者 https://www.devze.com 2023-03-23 19:58 出处:网络
I\'m writing up unit tests for a app but I\'m having difficulty keeping track of what scenarios I\'ve tested for in each me开发者_如何学Pythonthod.

I'm writing up unit tests for a app but I'm having difficulty keeping track of what scenarios I've tested for in each me开发者_如何学Pythonthod.

I'm currently using qunit and creating a testing directory for each object that I'm unit testing and a single file for each method I'm testing but how do you get a good overview of all your tests in an easy to digest form?

Ideally I'd like to have something

  • which could take my unit tests and add the test description next to the function which it relates to in the code itself so when in the code I can see the tests I've got for the method straight away
  • have some sort of easy to read overview of all my tests

Does anyone have any recommendations of tools or practices which may help out with this problem?


The projects I've worked on have all been Server+Client projects, where we had a suite of unit tests for our server side code, and wanted to integrate our client side unit tests into that process.

In that case, I have written a "Unit Test" in my server side code that opened up each QUnit test in a browser, then scraped the DOM for success/failure entries, and called Assert(false, text_scraped_from_dom). Then all of my qUint tests were run as part of my CI build and showed up as failing tests there.

I have done this for Java with httpunit, and for .NET with watin.

0

精彩评论

暂无评论...
验证码 换一张
取 消