Skip to content

Code coverage with karma-jspm #22

Open
@tauren

Description

@tauren

I'm using karma-coverage along with karma-jspm. Coverage reports are being generated, but only for source files that are referenced in test files. However, any source files that are not required from a test file doesn't show up in the coverage report.

Is this is because karma-jspm highjacks the karam files config, only including files that are referenced? Any ideas on how to get the coverage reports to list all source files so the reporting is more accurate?

Here's relevant portions of my karma config:

  config.set({
    frameworks: ['jspm','mocha','sinon-chai'],
    jspm: {
      loadFiles: ['app/**/test/**/*.test.js'],
      serveFiles: ['app/**/lib/**/*.js']
    },
    proxies: {
      '/jspm_packages/': '/base/jspm_packages/'
    },
    preprocessors: {
      'app/**/lib/**/*.js': ['coverage']
    }
};

I've attempted to include both tests and source files in jspm.loadFiles, but it blows up with errors. These are errors I may be able to resolve, but wanted to first find out if there is a better approach I should be taking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions