Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output with multiple reporters #480

Open
neutraali opened this issue Aug 10, 2022 · 0 comments
Open

No output with multiple reporters #480

neutraali opened this issue Aug 10, 2022 · 0 comments

Comments

@neutraali
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant