Coverage isn't calculated properly for non-SFC
See original GitHub issueVersion
3.0.5
Reproduction link
https://github.com/dmitriykirpa/vue-cli-jest-coverage-example
Environment info
System:
OS: macOS 10.15.4
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 14.2.0 - /usr/local/bin/node
Yarn: 1.21.0 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Browsers:
Chrome: 81.0.4044.138
Firefox: 70.0.1
Safari: 13.1
npmPackages:
@vue/cli-overlay: 4.3.1
@vue/cli-plugin-eslint: ^4.3.0 => 4.3.1
@vue/cli-plugin-router: 4.3.1
@vue/cli-plugin-unit-jest: ^4.3.0 => 4.3.1
@vue/cli-plugin-vuex: 4.3.1
@vue/cli-service: ^4.3.0 => 4.3.1
@vue/cli-shared-utils: 4.3.1
@vue/component-compiler-utils: 3.1.2
@vue/eslint-config-prettier: ^6.0.0 => 6.0.0
@vue/preload-webpack-plugin: 1.1.1
@vue/test-utils: 1.0.0-beta.31 => 1.0.0-beta.31
@vue/web-component-wrapper: 1.2.0
eslint-plugin-vue: ^6.2.2 => 6.2.2
jest-serializer-vue: 2.0.2
vue: ^2.6.11 => 2.6.11
vue-eslint-parser: 7.1.0
vue-hot-reload-api: 2.3.4
vue-jest: 3.0.5
vue-loader: 15.9.2
vue-style-loader: 4.1.2
vue-template-compiler: ^2.6.11 => 2.6.11
vue-template-es2015-compiler: 1.9.1
npmGlobalPackages:
@vue/cli: Not Found
Steps to reproduce
- Create a new
vue-cli
project (or configure it manually) withvue-jest
configured. - Move the
script
section from thesrc/components/HelloWorld.vue
to a separate filescript.js
. - Add the
<script src="./script.js" />
tosrc/components/HelloWorld.vue
- Run
yarn/npm run test:unit --coverage
- Observe the result.
What is expected?
Coverage for script.js
calculated properly
What is actually happening?
Coverage for script.js
is 0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Coverage Not Be Calculated - SonarQube - Sonar Community
We have been using SonarQube for a long time. There is a problem with calculation of coverage . I trigged a build request...
Read more >Frequently Asked Questions on the Code on Unit Trusts ... - SFC
An SFC-authorized fund is not expected to invest more than 10% of its net asset value (“NAV”) in ILS Investments. • Regardless of...
Read more >B7-3-06, Flood Insurance Requirements for All Property Types ...
Flood insurance is not required on a principal or residential detached ... SFC 180 No Flood Insurance — Not a Special Flood Hazard...
Read more >Survey of Consumer Finances (SCF) - Federal Reserve Board
To ensure that your question is properly routed, please select the Survey of Consumer Finances as the "Economic Data" and select no other...
Read more >How do I increase my code coverage, or why can't I cover ...
For purposes of calculating code coverage, only executable lines of ... loop never begins iterating because the query returns no records.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m experiencing the same issue, has there been any progress on this?
If anyone is super motivated to tackle this I can try to help out, I have many other higher priority bugs like proper TS support, releasing Test Utils v2, etc, so I was not able to tackle this.
As far as I can see it’s (mostly) working ok for SFCs? Is this just for non sfc components? Is the main use case JSX/TSX?