karma-coverage icon indicating copy to clipboard operation
karma-coverage copied to clipboard

Colors still output to text-summary file with colors:false set

Open harking opened this issue 10 years ago • 4 comments

I'm still seeing some escape characters when trying to output text-summary to a file with colors turned off...

module.exports = function(config) {
  config.set({
    basePath: '',
    autoWatch: true,
    frameworks: ['qunit'],
    files: [

    ],

    // list of files to exclude
    exclude: [
    ],

    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
    reporters: ['progress', 'coverage'],
    preprocessors: {
        'source/**/*.js': ['coverage']
    },

    plugins: [
      // these plugins will be require() by Karma
      'karma-coverage',
      'karma-qunit',
      'karma-phantomjs-launcher'
    ],

    colors: false,

    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera (has to be installed with `npm install karma-opera-launcher`)
    // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
    // - PhantomJS
    // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
    browsers: ['PhantomJS'],

    singleRun: false,

    coverageReporter: {
      type : 'text',
      dir : 'coverage/',
      file: 'coverage.txt'
    }
  });
};

harking avatar Nov 20 '13 01:11 harking

@harking is this still an issue?

dignifiedquire avatar Jun 09 '15 15:06 dignifiedquire

I can confirm that this is still an issue.

fiznool avatar Jun 28 '16 15:06 fiznool

@dignifiedquire This is still an issue....

jsloyer avatar Nov 22 '16 23:11 jsloyer

istanbul only suppresses color based on.. https://github.com/chalk/supports-color which checks argv for --no-color

so.. you need to run karma with --no-color to get the saved text-summary to not contain colors.

lukeapage avatar Oct 20 '17 19:10 lukeapage