Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocha + TypeScript + Istanbul = No coverage information was collected, exit without writing coverage information #611

Open
thitemple opened this issue May 2, 2016 · 4 comments

Comments

@thitemple
Copy link

thitemple commented May 2, 2016

I'm trying to get code coverage on my TypeScript code. The tests are written using mocha
I'm compiling the code to a directory using

tsc --outDir test

For those not used to TypeScript this is the same as doing this with babel:

babel src --out-dir lib

The the code is compiled and source map files are generated.

After that, I try to run istanbul with the command:

node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha test/**/*.spec.js

All the tests are passing, but the result is always:

No coverage information was collected, exit without writing coverage information

Is there something special I should do after compiling the TS code? Thanks.

PS: I tried versions 0.4.2 and 1.0.0-alpha.2

@xogeny
Copy link

xogeny commented May 24, 2016

Same question... 😢

@xogeny
Copy link

xogeny commented Jun 18, 2016

I eventually got this working. You can see my salvage repository to see what I had to do. Specifically, look in package.json for the cover script definition.

@awwong1
Copy link

awwong1 commented Jan 21, 2017

Hello! Has any progress been made on this since the issue opened on May 2nd 2016?

@iconnor
Copy link

iconnor commented Feb 21, 2017

I also have the same issue here in a learning/play app we are working on https://github.com/jacepatel/typescript-express-api maybe having an easy example will help narrow down the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants