Closed sukrosono closed 6 years ago
Also on h3 with Babel no note which file is that
Both belong into webpack.config.js
, feel definitely free to send a PR adding that :) by adding **webpack.config.js**
above these two code blocks.
I'm not too familiar with this module myself and haven't used it in a while, but something like that should do the trick
webpack.config.js
const config = {
...,
module: {
rules: [
{
test: /\.js$|\.jsx$/,
use: {
loader: 'babel-loader',
},
exclude: /node_modules/,
},
{
test: /\.js$|\.jsx$/,
use: {
loader: 'istanbul-instrumenter-loader',
options: { esModules: true }
},
enforce: 'post', // <= make sure to run after the `babel-loader` 'rule'
exclude: /(node_modules|\.spec\.js)$/,
}
]
}
}
Thank @michael-ciniawsky , but i still confuse with this question
I am little bit confuse, do i have to run coverage under webpack or karma?
In karma.conf.js
@michael-ciniawsky So sorry to brother you again, so in order to get the coverage i should run karma start karma.conf.js
to get my coverage report? is that correct ?
:confused:
karma-webpack
? 🙃
karma webpack say
Use webpack to preprocess files in karma
so it main runtime is in karma right, not webpack. so in order to get the coverage i should run karma start karma.conf.js to get my coverage report? is that correct ?
Yep
I am new to webpack and istanbul, and about to add coverage to my lib. I just follow the tutorial and found this module here.
I am little bit confuse, do i have to run coverage under webpack or karma?
The readme file is quite nice, but i under options and above maintainer there are sample of file. But no note which file is that? Also on h3 with
Babel
no note which file is that.I want submit a PR when that question is answered. Since two file (test/index.js, karma.conf.js) have note on which file should be edit.