Skip to content

Vue Components do not appear in code coverage if there is no style tag #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phouri opened this issue Nov 12, 2017 · 1 comment
Open

Comments

@phouri
Copy link

phouri commented Nov 12, 2017

Submitting

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request

Current behavior
If you have a component without style tags, it disappears from the coverage.
Adding an empty style block fixes this.
Expected behavior
Should still show up in coverage even without <style> tag

Minimal reproduction of the problem with instructions
Take any starter project for jest-vue, add a single file component - delete the style tag, run coverage.

What is the motivation / use case for changing the behavior?
Less wtf moments ;)

  • jest-vue-preprocessor: 1.1.X
    1.3.1

  • Node version : [ OSX ]
    8

  • Platform: [ OSX ]

This is not a big issue, just so if anyone else is pondering this - they can see why it's not working.

Also, removing mapCoverage from jest shows the missing file, but screws up the line obviously.

@giubatt
Copy link

giubatt commented Feb 27, 2018

I was having the exact same problem, couldn't figure out why it wasn't showing up on coverage, found this and tried adding the style tag and now it works.

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

No branches or pull requests

2 participants