Skip to content

Commit

Permalink
fix(build): upgrade to latest intrumenter-laoder config which doesn't…
Browse files Browse the repository at this point in the history
… need explicit coverage in karma config
  • Loading branch information
Hotell committed Nov 9, 2016
1 parent e6b7903 commit 7777b8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 9 additions & 2 deletions config/spec-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ var modules = requireAll(testContext);
* that will require the file and load it up here. Context will
* loop and require those spec files here
*/
function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
function requireAll( requireContext ) {
return requireContext.keys().map( ( path ) => {
try {
return requireContext( path );
} catch ( err ) {
console.error( '[ERROR] WITH SPEC FILE: ', path );
console.error( err );
}
} );
}
4 changes: 3 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ module.exports = function(config) {
* preprocess matching files before serving them to the browser
* available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
*/
preprocessors: { './config/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] },
preprocessors: { './config/spec-bundle.js': ['webpack', 'sourcemap'] },

// Webpack Config at ./webpack-test.config.js
webpack: testWebpackConfig,

coverageReporter: {
// specify a common output directory
dir : 'coverage/',
// multiple reporters
reporters: [
{ type: 'text-summary' },
{ type: 'json' },
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
"karma-firefox-launcher": "1.0.0",
"karma-jasmine": "1.0.2",
"karma-mocha-reporter": "2.2.0",
"karma-phantomjs-launcher": "1.0.1",
"karma-phantomjs-launcher": "1.0.2",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "1.8.0",
"lodash": "4.16.5",
"node-sass": "3.11.2",
"phantomjs-prebuilt": "2.1.7",
"phantomjs-prebuilt": "2.1.13",
"raw-loader": "0.5.1",
"remap-istanbul": "0.7.0",
"rimraf": "2.5.4",
Expand Down

0 comments on commit 7777b8c

Please sign in to comment.