Running istanbul 1.0.0-alpha.2 on babel generated code with [source-maps] option set to (https://babeljs.io/docs/usage/cli/) both (babel 6.6.5, babel-core 6.7.2) I got many warnings like that:
File [/Users/Yves/foo/bar.js] ignored, nothing could be mapped
Here is how I run istanbul:
istanbul cover _mocha -- ./test --compilers js:babel-register \
--require babel-polyfill \
--require should \
--require sinon
Just ran into this as well. I believe it has to do with named vs anonymous default exports.
I put together a super simple example repo that reproduces this here.
My current workaround is to just structure my code with named exports.
I'm getting this error in files whose only contents are named export statements, but of the following form:
/* eslint-disable */
// @create-index
export handle from './handle.js';
export throwEx from './throwEx.js';
(created via create-index).
On second thoughts, it kind of makes sense in my case as there's probably nothing to "cover" here.
any resolution to this? I don't want to create a massive commit changing every index.js export in my project...
I'm switching to jest: https://github.com/facebook/jest
@yvele after x hours (too embarrassed to say exactly how long) of trying to set up mocha and nyc to run the simplest possible unit test and generate a coverage report with ES6 import and export default, I tried going with your suggestion, and within 10 minutes, everything just freaking worked.
@bengrunfeld Yep it's way more easy.. jest replaces mocha, chai, istanbul, nyc, rewire.... and is way more powerful 馃槈
any update here?
Most helpful comment
Just ran into this as well. I believe it has to do with named vs anonymous
defaultexports.I put together a super simple example repo that reproduces this here.
File ... ignoredwarning and is not coveredMy current workaround is to just structure my code with named exports.