Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

skeleton-esnext test coverage report shows compiled code, not source code. #541

Closed
3cp opened this issue Jun 25, 2016 · 5 comments
Closed

Comments

@3cp
Copy link
Member

3cp commented Jun 25, 2016

From a clean skeleton repo, gulp cover yields coverage report like this.
Is this a known issue?

screen shot 2016-06-26 at 1 12 00 am

@EisenbergEffect
Copy link
Contributor

There's a PR in to address this which we are evaluating as well as a number of other solutions.

@stevies
Copy link

stevies commented Oct 11, 2016

Any update on this? Same problem in webpack skeleton.

@AshleyGrant
Copy link
Collaborator

#519 fixed it. Now it looks like this for skeleton-esnext:
image

I'm not sure how to run the coverage task on the webpack skeleton.

@stevies
Copy link

stevies commented Oct 11, 2016

In the webpack skeleton, run the tests - 'npm test' - that should generate the coverage.

It is set up to only generate JSON - you can change the reporter entry in karma.conf.js to get HTML.

coverageReporter: {
  reporters: [
    {
      type: 'json',
      subdir: '.',
      file: 'coverage-final.json'
    },
    {
      type: 'html',
      dir: './coverage'
    }
  ]
},

I see a problem that if you run it twice, some coverage report files get dumped into the src folder. These files appear to be reports on the non-transpiled source - but html image and css resource file paths are broken, so they don't display nicely. Plus, you don't want them in the src folder :-}

image

I have stopped these files getting generated by modifying the test runner script in package.json to delete the coverage directory before running:

  "test": "rimraf test/coverage && cross-env NODE_ENV=test ./node_modules/karma/bin/karma start test/karma.conf.js",

@AshleyGrant
Copy link
Collaborator

@stevies would you mind copying what you just posted to a new issue? I'm going to close this one as the initial issue has been fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants