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

No coverage information was collected in UBUNTU #659

Closed Sachin077 closed 8 years ago

Sachin077 commented 8 years ago

Here is my full command: node ./node_modules/istanbul/lib/cli.js cover --report cobertura --report html --hook-run-in-context -i ./_build\test\node_modules\vsts-task-lib*.js ./node_modules/mocha/bin/_mocha _build/test/tasklib.js

This command is for getting coverage reports of the Microsoft vsts-task-lib project (https://github.com/Microsoft/vsts-task-lib).

It works perfectly fine on windows and generates coverage reports. But on Ubuntu it shows "No coverage information was collected, exit without writing coverage information".

gotwarlost commented 8 years ago

Are you forking subprocesses in Ubuntu but not on windows? That would do it.

Sachin077 commented 8 years ago

Got it! Just one more question, Is there any way I can know the dependency tree of functions run by unit tests? As in for a particular test, say test number 1, I want to know which functions did it run from the source code and I want a dependency tree of those functions according to their parent-child relation. If I cannot get dependency tree, then can I atleast get the names of all functions called by a single unit test.

gotwarlost commented 8 years ago

No, istanbul doesn;t maintain this information.