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 785 forks source link

Question: can Istanbul be controlled while it is collecting code coverage data? #875

Open dtgriscom opened 6 years ago

dtgriscom commented 6 years ago

I'm starting to use Istanbul to measure code coverage with my Node-based server system under Linux. I'm using a custom test system that stimulates the server and evaluates results. I'd like to have Istanbul trace coverage while the testing runs, but at the moment I have to restart the Istanbul/server system before starting tests, and exit after every set of tests to generate the code coverage report.

I'd like to leave the Istanbul/server system running continuously, and without restarting a) reset the statistics, and b) trigger generation of the coverage report. This could be done internal to the server code (perhaps by calling Istanbul functions), or external to the server (perhaps by sending signals).

Is there a way to both a) reset the code coverage statistics and b) trigger writing of the coverage report(s) without exiting and restarting the whole system?

(Posted again at https://github.com/istanbuljs/nyc/issues/813 ...)