0

I am using karma to run my javascript tests, and to generate a coverage report. Here is my coverage configuration from the karma.conf.js:

coverageReporter: {
      dir : 'coverage/',
      reporters: [
        { type: 'text-summary' },
        { type: 'html' },
        { type: 'lcov' }
      ]
}

What I do not like about the set-up is that I always get a subfolder named after the browser used to run the tests. In my case, I use only PhantomJS, and would prefer to have the reports directly under /coverage. Is there a way to do this?

Bojana Popovska
  • 571
  • 1
  • 4
  • 15

1 Answers1

1

Seems subdir is determined from dir, not from dir/. So this works fine:

coverageReporter: {
      dir : 'coverage/',
      reporters: [
        { type: 'text-summary' },
        { type: 'html', subdir: '.' },
        { type: 'lcov', subdir: '.' }
      ]
    }
Bojana Popovska
  • 571
  • 1
  • 4
  • 15