I'm trying to use Istanbul along with Mocha in Node.js to run unit tests and generate code coverage reports. I'm using the following code to run run the unit tests and generate those code reports.
istanbul cover _mocha -- -R tap 'test/*.test.js' > test.tap; istanbul report clover
If I just want to run unit tests without code coverage reports I can just run the following.
mocha
Both of these methods work fine. But the first method doesn't really print anything to the console. I have no idea which unit test it is currently running and when it's all complete I have no idea what exactly went wrong. It doesn't provide any form of error logs or anything. The second method prints the status of that certain unit test after each test so it's easy in the console to see exactly what unit test you are currently working on and after all tests are complete it gives you details and error logs about why they failed so you can start to debug. The first method doesn't provide any of this.
Is there anyway to generate code coverage reports using Istanbul but have it print all the details to the console that just running mocha
prints? If so how can I achieve this? Some of my tests take a little bit to run and finish so when generating code coverage reports with Istanbul it would be nice to see exactly what test it's currently on and more detail about the test in real time.