Open catamphetamine opened 9 years ago
faced the same issue
Was facing the same issue and came across isparta. After a bit of meddling around I made it work for my repo https://github.com/sivakumar-kailasam/broccoli-leasot/commit/ff5f848b4104b131fcb47fc494d6455cf32182c4 . You can see it working at https://codeclimate.com/github/sivakumar-kailasam/broccoli-leasot/coverage/55b70ac20d7e0c07370386ad
@sivakumar-kailasam I was able to get it working with isparta as well. The only problem I still have with it is that it won't cover .jsx files which istanbul is able to do.
@justincdalton My setup:
test/**/*.es6
src/**/*.es6
dist/**/*.js
Relevant package.json
entry:
{
"cover": "babel-node node_modules/.bin/isparta cover --include '**/*.es6' node_modules/.bin/_mocha -- 'test/**/*.es6' --reporter dot"
}
Relevant .istanbul.yml
entry:
instrumentation:
root: src
extensions:
- .es6
I guess you can replace es6
with jsx
and it Just Works™.
I use it like this:
And when I look at the code coverage reports they show coverage for the transpiled code. How can I generate coverage for the original ES6 code? I guess Babel should output some source maps. Or does istanbul support ES6 natively? (and what's the command)