nyc-line-visit-count-reporter v0.1.0
nyc-line-visit-count-reporter
Note: This project is somewhat unstable. It also requires use of an nyc fork in order to get options passed to it.
Installation
npm i -D nyc-line-visit-count-reporterUsage
Note that for this reporter to work, you cannot set instrument to false.
For running tests, e.g., with Mocha:
nyc --reporter-options <option1=val1> --reporter-options <option2=val2> --reporter nyc-line-visit-count-reporter npm run mochaFor reporting on results after the fact:
nyc report --reporter-options <option1=val1> --reporter-options <option2=val2> --reporter nyc-line-visit-count-reporterReporter options
absolutePaths
Whether to show absolute paths instead of paths relative to the current working directory.
Defaults to false.
maxItems
How many items to display. Defaults to 10.
outputFile
A single relative file path (relative to the coverage directory) to which to
write the output. Defaults to null (i.e., writes to console.
file
File, semi-colon-separated list of files, or array of files to be reported on.
Defaults to not being used.
noAggregate
Whether to avoid calculating maxItems relative to the results across
files in aggregate rather than per file.
If true, will group the items by file, with each group listing the
number of maxItems per file group.
If false, will only list one set (limited by maxItems), sorting
exclusively by visit count (though listing file name for each entry).
The available file groups will be all covered files unless file is set.
Defaults to false.
To-dos
- Get tests working consistently with coverage
- See about avoiding need for fork
--reporter-options; see nyc PR# 1312.
Possible to-dos
- Interactive mode where one can selectively open files (with line/column as IDEs such as Atom understand) by number.
- Could add
es6-template-stringsto allow user to control appearance - Others data besides on statements:
- Top visited functions (or the function within which a
statement occurs) along with the function
name.lineandcolumnofloc.startandloc.end(ordecl.startanddecl.end?) - Top visited branches, along with its
type(e.g., switch) and whether it was for aniforelse(the first or second item in thebarray).lineandcolumnofloc.startandloc.end(shouldn't needlocationswhich list locations of all branches, e.g., of a switch or if-else)
- Top visited functions (or the function within which a
statement occurs) along with the function
6 years ago