Skip to content
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

Coverage report is complaining about non existing lines of code #522

Closed
Envoy49 opened this issue Dec 22, 2022 · 1 comment
Closed

Coverage report is complaining about non existing lines of code #522

Envoy49 opened this issue Dec 22, 2022 · 1 comment

Comments

@Envoy49
Copy link

Envoy49 commented Dec 22, 2022

Have an issue after an update, where coverage report is complaining about non existing lines of code.
Since I am using NUXT and had to upgrade to the latest NUXT Bridge.
Code coverage is complaining about my VUE code files not being covered.
Whereas most of them were covered on 100% according to old and correct report..
After an update coverage is complaining about lines which don't exist at all.
My overall coverage dropped from 70% to 40% due to this wrong report
Below is the screenshot of before and after results.

image

My current package.json

"dependencies": {
   "nuxt-edge": "latest",
 },

 "devDependencies": {
   "@vue/test-utils": "1.3.3",
   "@vue/vue2-jest": "29.0.0",  
   "vue-template-compiler": "^2.7.14"
 },

My previous package.json:

"dependencies": {
   "nuxt-edge": "^2.16.0-27358576.777a4b7f",
 },

 "devDependencies": {
   "@vue/test-utils": "^1.2.2",
   "@vue/vue2-jest": "^27.0.0-alpha.4",
 },

Solution from here #480 (comment) didn't help in my case

We have so many coverage issues reported long time now and none of them resolved:

#500
#488
#480
#504
#514

@Envoy49
Copy link
Author

Envoy49 commented Dec 23, 2022

Upgrading couple of packages and editing jest.config.ts fixed the issue with coverage.

package.json

"@types/jest": "^29.2.2",
"jest": "^29.3.1",
"jest-environment-jsdom": "29.3.1",
"ts-jest": "^29.0.3",

jest.config.ts

  moduleNameMapper: {
    "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
      "<rootDir>/tests/mocks/fileMock.ts",
    uuid: require.resolve("uuid"),
  },
 coverageProvider: "v8",

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

1 participant