gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Add named anchors to all line numbers... #786

Open the-t-in-rtf opened 7 years ago

the-t-in-rtf commented 7 years ago

In the output of the html reporter, line numbers are presented as text. In discussing a code coverage report, it would be helpful to be able to refer to a particular line number. This can be easily accomplished by updating the reporter to add anchor tags around each line number, as in:

<a name="L1234"></a><a href="#L1234>1234</a>

If there are no objections, I'm happy to submit a simple PR to make this happen.

the-t-in-rtf commented 7 years ago

I have prepared and tested a pull here: https://github.com/gotwarlost/istanbul/pull/787

the-t-in-rtf commented 7 years ago

Here's an example of a working deep link in output I generated using the modified HTML reporter.