You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Intellij Idea + karma plugin to run karma tests.
Namely, I want to run test coverage.
The issue is that when I run a test with coverage Idea asking me for lcov.info:
my karma.conf.js is the following:
module.exports=function(config){return{// base path, that will be used to resolve files and exclude// basePath: '',// frameworks to useframeworks: ['jasmine','requirejs'],// list of files / patterns to load in the browserfiles: [//require.config file{pattern: 'src/require.config.js'},// tests env libraries{pattern: 'src/bower_components/jquery/dist/jquery.js'},{pattern: 'src/bower_components/jquery-simulate/jquery.simulate.js'},{pattern: 'src/bower_components/jasmine-jquery/lib/jasmine-jquery.js'},{pattern: 'src/bower_components/sinonjs/sinon.js'},{pattern: 'src/bower_components/sinon-ie/sinon-ie.js'},{pattern: 'src/bower_components/jasmine-sinon/lib/jasmine-sinon.js'},//source files{pattern: 'src/**/*.js',included: false},{pattern: 'src/**/*.htm',included: false},{pattern: 'src/**/*.json',included: false},//all related tests files{pattern: 'test/tools/testEnvironment.css'},{pattern: 'test/tools/custom.matchers.js'},{pattern: 'test/tools/jasmine.ext.js'},{pattern: 'test/tools/jquery.cookies.js'},{pattern: 'test/mock/**/*.js',included: false},//tests loader'test/test/test-main.js'],// list of files to excludeexclude: [],// test results reporter to use// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'reporters: ['spec','junit'],preprocessors: {// source files, that you wanna generate coverage for// do not include tests or libraries// (these files will be instrumented by Istanbul)'src/!(bower_components)/**/*.js': ['coverage']},junitReporter: {outputFile: 'test/karma-reports/test-results.xml'},coverageReporter: {includeAllSources: true,reporters: [{type : 'html',dir : 'test/karma-coverage/coverage/html'},{type : 'cobertura',dir: 'test/karma-coverage/coverage'}]},// web server portport: 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_DEBUGlogLevel: config.LOG_ERROR,// enable / disable watching file and executing tests whenever any file changesautoWatch: false,// 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"],// If browser does not capture in given timeout [ms], kill itcaptureTimeout: 60000,browserNoActivityTimeout: 1000000,// Continuous Integration mode// if true, it capture browsers, run tests and exit//singleRun: true,plugins: ["karma-jasmine","karma-phantomjs-launcher","karma-chrome-launcher","karma-coverage","karma-junit-reporter","karma-spec-reporter","karma-jasmine-html-reporter","karma-requirejs"]};};
if I'm adding coverage reporter manually it becomes working ok:
I'm using Intellij Idea + karma plugin to run karma tests.
Namely, I want to run test coverage.
The issue is that when I run a test with coverage Idea asking me for
lcov.info
:my karma.conf.js is the following:
if I'm adding
coverage
reporter manually it becomes working ok:however i do not want to have 'coverage' in my reporters by default - it slows down tests.
The solution is to add
coverage
reporter inintellijCoverageReporter.js
, see my pull requestThe text was updated successfully, but these errors were encountered: