# JSCoverage
code coverage for JavaScript

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, 7, and 8), Firefox, Opera, Safari, and Google Chrome - on Microsoft Windows and GNU/Linux.

JSCoverage is free software, distributed under the GNU General Public License version 2.

## Latest News

### April 24, 2010 - JSCoverage 0.5

JSCoverage 0.5 is available for download.

This release contains a number of new features and bug fixes:

- A new mode of operation, called "window mode", allows you to run code in a new browser window (or tab).
- Code coverage statistics can now be generated for applications based on the Mozilla platform using the `--mozilla` option (thanks to Murali Nandigama for help creating this).
- The method used to calculate overall percentage code coverage for all files has changed. Previously, the calculation was done using an unweighted average: each file's percentage code coverage contributed equally to the total, regardless of the number of lines of code in the file. Now, the calculation is done using a weighted average. This fixes bug #6 (thanks to Liu Cougar).
- Contiguous lines in the "Missing" column are now grouped together (thanks to Liu Cougar).
- The "Source" tab is no longer empty when code being tested throws an uncaught exception (fixing bug #5)
- Previously, certain uses of the `new` operator were instrumented incorrectly; this has now been fixed (thanks to Guillaume Lung).
- The `jscoverage-server` program now allows more characters in URLs (thanks to Guillaume Lung).
- The `jscoverage-server` program now handles HTTP headers with empty values (thanks to Velo).
- The `jscoverage` program now refuses to instrument code which has already been instrumented (thanks to Velo).
- URLs containing spaces now work correctly (thanks to Igor Papkov).
- Previously, on Windows, the `jscoverage` program was unable to instrument a directory in a drive root; this has now been fixed.
- Encoded URLs are now handled better in the query string.
- A limitation of 65,535 lines per file and 65,535 characters per line has been removed.
- Floating-point numbers are now handled with improved precision.
- The `jscoverage-server` program can no longer bind to the same port multiple times on Windows.
- Some bugs in `jscoverage-server`'s handling of the "chunked" Transfer-Encoding have been fixed.
- Compilation under Cygwin now uses the `-mno-cygwin` flag.
- The wire format used for submitting coverage reports for storage by `jscoverage-server` has changed. (This change will not have any visible effects for most users; it will only be of interest to those who have written code which parses that format.)

All news items...