-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Can't generate valid coverage reports from compiled tag files. For example: With karma lcov reporting, compiled tag file's coverage is not correctly reported.
Reproduce:
Example project:
git clone https://github.com/vitogit/tdd-mocha-chai-riot
Karma Config (updated):
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['mocha','chai','riot'],
plugins: [
'karma-mocha',
'karma-mocha-reporter',
'karma-phantomjs-launcher',
'karma-chai',
'karma-riot',
'karma-coverage'
],
files: [
'node_modules/chai/chai.js',
'src/**/*.tag',
'test/**/*.js'
],
preprocessors: {
'**/*.tag': ['riot', 'coverage'],
'src/**/*.js': ['coverage']
},
coverageReporter: {
dir: 'coverage/',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'text', subdir: '.', file: 'text.txt' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
{ type: 'lcovonly', subdir: '.', file: 'lcov.info' }
]
},
browsers: ['PhantomJS'],
reporters: ['mocha', 'coverage'],
failOnEmptyTestSuite: false,
autoWatch: true
})
}
How to run?
npm i && npm i karma-coverage --save-dev
karma start
cat coverage/lcov.info
You can also see html based coverage reports inside coverage directory's html coverage reports.
LCOV is incorrect:
HTML is correct:
Reactions are currently unavailable

