karma-runner / karma-runner/karma-coverage

Problem with includeAllSources, webpack and isparta-instrumenter

Open
#192 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
771
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Using the `isparta-instrumenter` with `webpack` and `karma-coverage` I can't make the option `includeAllSources` to work.

Here is my webpack config:

``` javascript
{
/** ... */,
module: {
preLoaders: [
{
test: /\.jsx?$/,
include: path.resolve('src'),
loader: 'isparta-instrumenter'
}
],
loaders: /** ... */
},
/** ... */
}
```

Here is the `karma.conf.js`:

``` javascript
config.set({
basePath: path.resolve('.'),
frameworks: ['mocha'],
files: [
'tests/EntryPoint.js'
],
preprocessors: {
'tests/**/*.js': ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: statsOptions
},
reporters: ['progress', 'coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage',
includeAllSources: true
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
captureTimeout: 60000,
singleRun: true,
plugins: [
'karma-webpack',
'karma-mocha',
'karma-coverage',
'karma-chrome-launcher'
]
});
```

I get the html output but the untested files are missing. Did anybody make this option work with `isparta-instrumenter` and `webpack`? I'm pretty sure there is no issue here but I can't find the correct configuration.

I tried adding `coverage` as a preprocessor for my source file but it seems to fail because they are ES6 or JSX files.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.