Bojana Popovska
Bojana Popovska

Reputation: 601

Karma report browser subfolders

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?

Upvotes: 1

Views: 741

Answers (1)

Bojana Popovska
Bojana Popovska

Reputation: 601

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: '.' }
      ]
    }

Upvotes: 2

Related Questions