IntelliJ ultimate code coverage feature disabled

I created a config for running mocha based unit tests in IntelliJ.  According to the documentation if I install nyc, it should enable code coverage in the IDE, but the icon is disabled.  What am I missing?

0
5 comments

What IDEA version do you work with? Can you attach a screenshot of your run configuration?

0

IntelliJ IDEA 2017.1.5 (Ultimate)

0

Code coverage for Mocha is supported since 2017.2 - see https://www.jetbrains.com/webstorm/whatsnew/#v2017-2-mocha, https://blog.jetbrains.com/webstorm/2017/06/webstorm-2017-2-eap-172-2953/. There is no such feature in 2017.1.x. Please try upgrading

0

Thanks updating the version gave me the option.  Now that I ran it I can see it's ignoring my .jsx files.  Normally when I run nyc at the command prompt I run this.

Is there a place to add the --extension .jsx portion to what IntelliJ is doing?

nyc --extension .jsx --extension .es6 --reporter=lcov --reporter=text npm test
0

You can specify additional extensions in .nycrc file or package.json, like:

"nyc": {
"extension": [
".jsx",
".es6"
]
}

see https://github.com/istanbuljs/nyc#configuring-nyc

0

Please sign in to leave a comment.