Skip to content

No output with multiple reporters #480

Open
@neutraali

Description

@neutraali

Using the NodeJS API, let's say our config is like this:

let KarmaConfig = {
	plugins: [
		'karma-chai',
		'karma-mocha',
		'karma-sourcemap-loader',
		'karma-webpack',
		'karma-mocha-reporter',
		'karma-chrome-launcher'
	],
	singleRun: true,
	autoWatch: false,
	frameworks: ['mocha', 'chai', 'webpack'],
	reporters: ['mocha'],
	// . . . 
};

If I add the coverage -stuff, everything works fine:

KarmaConfig.plugins.unshift('karma-coverage');
KarmaConfig.reporters.push('coverage');
KarmaConfig.coverageReporter = { // https://github.com/karma-runner/karma-coverage
	dir: 'test/coverage',
	reporters: [
		{ type: 'text' },
		{ type: 'text-summary' },
		{ type: 'lcovonly', subdir: '.', file: 'istanbul-coverage.txt' }
	]
};

However, if I add stuff like sonarqube the code coverage reporting stops working (results in an empty coverage report; mocha and sonarqube reporters work fine):

KarmaConfig.plugins.unshift('karma-sonarqube-reporter');
KarmaConfig.reporters.push('sonarqube');
KarmaConfig.sonarqubeReporter = { // https://github.com/fadc80/karma-sonarqube-reporter
	basePath: 'test',
	outputFolder: 'test/coverage',
	filePattern: '**/*.js',
	encoding: 'utf-8',
	reportName: 'sonarqube-execution.xml'
}

All this is with:

"karma": "6.3.19"
"karma-chai": "0.1.0"
"karma-chrome-launcher": "3.1.1"
"karma-coverage": "2.2.0"
"karma-mocha": "2.0.1"
"karma-mocha-reporter": "2.2.5"
"karma-sonarqube-reporter": "1.4.0"
"karma-sourcemap-loader": "0.3.8"
"karma-webpack": "5.0.0"

Anyone else experiencing this kind of issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions