webpack-contrib / istanbul-instrumenter-loader

Istanbul Instrumenter Loader
MIT License
273 stars 65 forks source link

Getting issue while running the webpack in Jenkins #23

Closed areddy7021 closed 7 years ago

areddy7021 commented 8 years ago

The webpack tests are running with the coverage summary in my mac when i run nom test and the same way its not coming up with the jenkins console output while i run on jenkins server. Am i missing anything ? teh below is the one it shows in my mac

screen shot 2016-05-10 at 12 52 56 am

in jenkins

screen shot 2016-05-10 at 12 54 22 am

I have made my npm test command returning true always . I have tried both the ways , it never worked for me.

here is my karma conf

// Reference: http://karma-runner.github.io/0.12/config/configuration-file.html module.exports = function karmaConfig (config) { config.set({ frameworks: [ // Reference: https://github.com/karma-runner/karma-jasmine // Set framework to jasmine 'jasmine' ],

reporters: [
  // Reference: https://github.com/mlex/karma-spec-reporter
  // Set reporter to print detailed results to console
  'progress',
    'verbose',
    'dots',

  // Reference: https://github.com/karma-runner/karma-coverage
  // Output code coverage files
  'coverage'
],

files: [
  // Grab all files in the app folder that contain .spec.
  //'src/tests.webpack.js'
  'test/tests.webpack.js'
],

preprocessors: {
  // Reference: http://webpack.github.io/docs/testing.html
  // Reference: https://github.com/webpack/karma-webpack
  // Convert files with webpack and load sourcemaps
  'test/tests.webpack.js': ['webpack', 'sourcemap']
},

browsers: [
  // Run tests using PhantomJS
  'PhantomJS'
],

singleRun: true,

// Configure code coverage reporter
coverageReporter: {
  dir: 'coverage/',
  reporters: [
    {type: 'text-summary'},
    {type: 'html'}
  ]
},

webpack: require('./webpack.config'),

// Hide webpack build information from output
webpackMiddleware: {
  noInfo: 'errors-only'
}

}); };

deepsweet commented 8 years ago

hi. sorry I can't reproduce this because I'm not using Jenkins. it may be a problem with karma-coverage reporter or something.

mattlewis92 commented 7 years ago

v1+ of this loader didn't work well with karma-coverage, so I wrote this reporter instead that you can use as a replacement, which should solve the issues you were experiencing: https://github.com/mattlewis92/karma-coverage-istanbul-reporter