JSCoverage is a tool that measures code coverage for JavaScript programs.
Code coverage statistics show which lines of a program have been executed (and which have been missed). This information is useful for constructing comprehensive test suites (hence, it is often called test coverage).
JSCoverage works by instrumenting the JavaScript code used in web pages. Code coverage statistics are collected while the instrumented JavaScript code is executed in a web browser.
JSCoverage supports the complete language syntax described in the ECMAScript Language Specification (ECMA-262, 3rd edition). JSCoverage works with any modern standards-compliant web browser - including Internet Explorer (IE 6 and IE 7), Firefox (FF 2 and FF 3), Opera, Safari, and Google Chrome - on Microsoft Windows and GNU/Linux.
JSCoverage is free software, distributed under the GNU General Public License version 2.
JSCoverage 0.4 is available for download.
This release includes many new features:
jscoverage-server program is provided as an
alternative to the jscoverage program. The
jscoverage-server program is a simple HTTP server which
instruments JavaScript code as it is served; this allows you to execute
JavaScript and gather code coverage statistics without a preliminary
step of creating instrumented code. The jscoverage-server
program can either serve files directly from the filesystem or run as a
proxy server (with the --proxy option), instrumenting
JavaScript provided by another web server.
jscoverage-server, coverage reports can now be stored
to the filesystem.
--encoding option provides better support for
different character encodings.
--no-highlight option can be used to disable syntax
highlighting (giving better performance for large JavaScript files).
make install
only installs the jscoverage and
jscoverage-server executables and their manual pages.
(Previous versions installed SpiderMonkey library and executable files,
which could conflict with other versions of SpiderMonkey installed on
your system.)
for each loops
let keyword
--js-version option to enable these features.
The GCC C++ compiler (g++) is now required to compile
JSCoverage. (Previously, only the C compiler was needed.)
Please report any bugs you find using the new bug tracker.
The JSCoverage FAQ has been updated to address problems using JSCoverage with Firefox 3.
JSCoverage is now available in the Debian unstable distribution.