isparta-loader
isparta-loader copied to clipboard
cannot compile ES6 files properly when it's used as preLoaders of Webpack in Karma
this is a part of my karma.conf.js:
preLoaders: [
{
test: /\.js$/,
loader: 'isparta',
include: path.resolve(__dirname, './src/'),
query: {
babel: {
presets: ['es2015', 'stage-0', 'react']
}
}
}
]
then i run test using karma, it said:
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
Error: Cannot find module "../../src/components/userfeedback"
at /Users/kM/Web/ali-baichuan/baichuan-console-static/test/components/userfeedback-test.js:55 <- webpack:///test/components/userfeedback-test.js:3:0
and this is a part of my userfeedback-test.js:
import UserFeedback from '../../src/components/userfeedback';
the interesting thing is that, when i use isparta-instrumenter-loader, which is deprecated, the test runs successfully. Following is a part of my new karma.conf.js:
preLoaders: [
{
test: /\.js$/,
loader: 'isparta-instrumenter',
include: path.resolve(__dirname, './src/'),
query: {
babel: {
presets: ['es2015', 'stage-0', 'react']
}
}
}
]
Was trying to solve a similar issue, but noticed that your issue may be the same as #20.
just use https://github.com/istanbuljs/babel-plugin-istanbul
Is there any progress? I'm getting the same issue.
just use https://github.com/istanbuljs/babel-plugin-istanbul