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

Can't get proper unit test coverage with jasmine-node #261

Open avishaan opened 10 years ago

avishaan commented 10 years ago

I have a standard node.js mongoose app which I run with node app.js. I also have my tests which I run with jasmine-node ./tests/runner.js.

My tests will test two things. It will test my api interface using superagent as well as directly require some of my models from my node app and test that functionality directly.

My problem is when I run istanbul cover app.js everything that I 'unit test' by requiring directly in my test suits is not shown in the test coverage amount but anything tested via the interface is checked ok.

You can check out my repo here for reference purposes. https://github.com/codeHatcher/quippics

batcoder1 commented 6 years ago

istambul cover --include-all-sources jasmine-node test

test is the folder that contain all tests