istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.55k stars 353 forks source link

How can I configure default sort in lcov reports? #1504

Open doublethefish opened 1 year ago

doublethefish commented 1 year ago

Link to bug demonstration repository

n/a

Expected Behavior

To be able to configure lcov's HTML report to sort by coverage % by default, percolating least covered files to the top.

I have not yet been able to work out how to change the default sort order generated by lcov when using the NYC middlewhere.

We have a project that mandates 100% coverage so being able to quickly find the uncovered files would be awesome. I imagine it's really easy, but I'm being really dumb.

image

Observed Behavior

Reports are sorted by file-first.

image

Troubleshooting steps

Environment Information

  Binaries:
    Node: 18.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  npmPackages:
    nyc: ^15.1.0 => 15.1.0
    source-map-support: ^0.5.21 => 0.5.21
    ts-node: ^10.9.1 => 10.9.1
    typescript: ^4.9.4 => 4.9.4
artbindu commented 1 year ago

Yes it's good to add some configuration in .nycrc.json for this default sort of test report.