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 #45

Closed
tadjik1 opened this issue Apr 20, 2015 · 4 comments
Closed

code coverage #45

tadjik1 opened this issue Apr 20, 2015 · 4 comments

Comments

@tadjik1
Copy link

tadjik1 commented Apr 20, 2015

Hello. Please help me to create code coverage report for my tests.
I'm trying to do this this way:

...
files: [
      'tests.webpack.js'
    ],

    preprocessors: {
      'scripts/**/*.js': ['webpack', 'sourcemap', 'coverage'],
      'tests.webpack.js': ['webpack', 'sourcemap', 'coverage']
    },

    reporters: ['progress', 'sourcemap', 'coverage'],

    webpack: {
      devtool: 'inline-source-map',
...    

but in /coverage folder i just see coverage of my tests.webpack.js file without sourcemaps!

So, what did I do wrong?

@gabel
Copy link

gabel commented Apr 21, 2015

I've added an extended example Karma + Webpack + Mocha + Chai + Istanbul including coverage... you can have a look into https://github.com/gabel/karma-webpack-example

The preprocessor chain doesn't work out for me, thats why I used https://github.com/deepsweet/istanbul-instrumenter-loader.

@tadjik1
Copy link
Author

tadjik1 commented Apr 21, 2015

@gabel Thank you very much! Very useful example. But what will you do when your js file would be transpiled via babel? I can not turn on sourcemaps for this situation.

@gabel
Copy link

gabel commented Apr 22, 2015

Good question, it will probably need to run through webpack via loader instead of the karma preprocessor, but thats just guessing.

@joshwiens
Copy link
Contributor

Need to know if this is still an issue. For the sake of efficiency, we are starting with current versions and the team can work back from there.

If this is still an issue on a recent version of the loader & it's peerDeps, please respond here so we can get this properly answered.

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

3 participants