views:

1891

answers:

3

Looking for a Javascript code coverage tool.

Ideally, I'd be able to easily integrate with continuous builds. Looking for something that I can run cross-platform, but Windows only tools may be able to work.

Does anybody have any good recommendations of tools to use or what tools to avoid?

Note: I've already read through this question: http://stackoverflow.com/questions/39329/what-is-your-favourite-code-coverage-tools-free-and-non-free. I'm looking at specifically analyzing Javascript code coverage.

+3  A: 

A quick google search revealed JSCoverage. With coverage, you will need a unit testing framework (otherwise the coverage is a lot less useful). For that, I would recommend JSUnit. It has some quirks (it slows down if you have it open for manually running, due to some leaks or something, but refreshing the page solves that), but it's really useful.

I have no experience with JSCoverage, but I can vouch for JSUnit.

Mike Stone
+1  A: 

Firebug Code Coverage is a Firebug extension that allows you to measure coverage without using an external tool to add instrumentation to the code like you have to with JSCoverage.

Ates Goral
Ates, this looks interesting. Going to check it out.
Ryan Guest
Unfortunately no longer works with FF 3.5.3
Chad
+3  A: 

Check out http://hrtimer.mozdev.org/. It includes a tool called "HRCov", which will give you line-by-line code coverage without modifying your code at all.