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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Coverage File Automatically on Test Command?

tracyalison11 opened this issue · comments

Is there any configuration setting that serves or pops open the coverage file in a browser window? I am looking for a solution to have it open up on command instead of digging for the file and opening static html. Thanks so much for any direction on this and thanks for writing this package! Huge help to our team.

commented

Hey there @tracyalison11!
If you're using npm or yarn, would calling

test: [incantations of all the testing and covering] && open coverage/lcov-report/index.html

not work?

Or even have a script such as:

"openCoverage": "open coverage/lcov-report/index.html"

And calling npm run openCoverage or yarn openCoverage work?

Thank you so much! Implemented this and it works!