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

Created on 3 May 2016  路  4Comments  路  Source: gotwarlost/istanbul

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

Most helpful comment

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

All 4 comments

Same question... :cry:

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.

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

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ouhouhsami picture ouhouhsami  路  16Comments

asciidisco picture asciidisco  路  47Comments

schulzch picture schulzch  路  151Comments

amoufaddel picture amoufaddel  路  28Comments

briancullinan picture briancullinan  路  22Comments