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

Code coverage with Istanbul #2

Closed
blakeembrey opened this issue Jul 15, 2015 · 6 comments
Closed

Code coverage with Istanbul #2

blakeembrey opened this issue Jul 15, 2015 · 6 comments
Assignees
Labels
you can do this Good candidate for a pull request.

Comments

@blakeembrey
Copy link
Member

I spent a long time trying to resolve this already, but can't find a decent solution. I started based on https://github.com/babel/babel/blob/master/packages/babel/src/api/register/node.js with process.env.running_under_istanbul and got it executing but got stuck with no coverage information coming out.

@blakeembrey
Copy link
Member Author

Istanbul 1.0 alpha.

@silviogutierrez
Copy link

So I'm trying the alpha as you suggested, but I still get no info coming out. Here's the command:

./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --compilers ts:ts-node/register client/test.ts

Test passes fine, but it prints:

No coverage information was collected, exit without writing coverage information at the bottom.

Am I missing something? I'm on istanbul 1.0 alpha 2.

Thanks,

Silvio

@silviogutierrez
Copy link

Think I solved it! For the curious, you need an .istanbul.yml file. Mine is currently:

instrumentation:
  extensions:
    - .tsx
    - .ts

And it seemed to work.

@sinedied
Copy link

I still can't make it work with [email protected] and jasmine: sourcemaps are broken for the jasmine reporters and something crash after the test executions :(

Without istanbul the tests run fin with jasmine.

@jonaskello
Copy link
Contributor

I found this comment very helpful. Basically use nyc command to run instanbul instead of the istanbul command and it works.

@sinedied
Copy link

@jonaskello that's what I end up using, nyc works fine with ts-node without any pain.

kumarashwin added a commit to kumarashwin/ts-node that referenced this issue Jun 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
you can do this Good candidate for a pull request.
Projects
None yet
Development

No branches or pull requests

4 participants