We have a large angular app, conveniently located in src/client/app. Karma currently runs "fine" -- it gives us a coverage summary with a percentage of results. Since it's a large project, we have 3 teams working in 3 subdirectories. How do I get a code coverage report for src/client/app/foo as compared with src/client/app/bar as compared with src/client/app/baz ?
I'd be satisfied with a result for each of the directories within src/client/app/*, if that's cleanest.
Thanks.
This is our current karma.conf.js:
module.exports = function(config) {
var gulpConfig = require('./gulp.config')();
var opts = {
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: './',
client: {
captureConsole: false
},
// frameworks to use
// some available frameworks: http://ift.tt/1ft83uu
frameworks: ['mocha', 'chai', 'sinon', 'chai-sinon', 'fixture'],
// list of files / patterns to load in the browser
files: gulpConfig.karma.files,
// list of files to exclude
exclude: gulpConfig.karma.exclude,
proxies: {
'/': 'http://localhost:8888/'
},
// preprocess matching files before serving them to the browser
// available preprocessors: http://ift.tt/1gyw6MG
preprocessors: gulpConfig.karma.preprocessors,
jsonFixturesPreprocessor: {
variableName: '__json__'
},
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-coverage',
'karma-mocha',
'karma-chai',
'karma-sinon',
'karma-chai-sinon',
'karma-fixture',
'karma-html2js-preprocessor',
'karma-json-fixtures-preprocessor',
'karma-tang',
'karma-tap-reporter'
],
// test results reporter to use
// possible values: 'dots', 'progress', 'coverage'
// available reporters: http://ift.tt/1ft83KQ
// bens - added verbose reporter, e.g. karma start --reporters verbose
reporters: ['progress', 'coverage', 'tap'],
coverageReporter: {
dir: gulpConfig.karma.coverage.dir,
reporters: gulpConfig.karma.coverage.reporters
},
tapReporter: {
outputFile: './unit.tap',
disableStdout: true
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR ||
// config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: http://ift.tt/1ft83KU
// browsers: ['Chrome', 'ChromeCanary', 'FirefoxAurora', 'Safari', 'PhantomJS'],
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
};
if (process.env.console) {
opts.client.captureConsole = true;
}
config.set(opts);
};
Aucun commentaire:
Enregistrer un commentaire