Forked from taras42/karma-jasmine-html-reporter This fork brought to you by an issue on jasmine: Feature Request: Sourcemap support Thanks to
- @taras42 for the Fork.
- Guntars Ašmanis for the idea/insperation/implentation
- James Salter for sourcemapped-stacktrace
Reporter that dynamically displays tests results at debug.html page, with source map support. Jasmine 1.3 is not supported.
You can also run describe block, or single test.
The easiest way is to keep karma-jasmine-html-reporter-sourcemaps
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-jasmine-html-reporter-sourcemaps": "~0.1"
}
}
You can simple do it by:
npm install karma-jasmine-html-reporter-sourcemaps --save-dev
see example
// karma.conf.js
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
preprocessors: {
// add webpack as preprocessor
'test/*_test.js': ['webpack', 'sourcemap'],
'test/**/*_test.js': ['webpack', 'sourcemap']
},
reporters: ['karma-jasmine-html-sourcemaps']
});
};
Currently only inline-source-maps are supported.
// webpack.config.js
module.exports = {
devtool: 'inline-source-map'
};
You can pass list of reporters as a CLI argument too:
```bash
karma start --reporters karma-jasmine-html-sourcemaps
- Currently only works with
inline-source-map
- When using
source-map-loader
, it has a bug, where if more then one files gets preprocessed with a source map, you don't get any source maps from the preprocessors (you still get all of the source maps created prior to karma though). ** Fixes:
- webpack before calling karma
- Only preprocess 1 file for webpack. Utilizing karma-webpack's Alternative usage, works well for this.