Open wopian opened 2 years ago
Odd, definitely a bug. Is this something you might be interested in looking into? I'd recommend trying to reproduce it in this repo next, then we can easily debug, test and deploy a fix. You could add a test project here: https://github.com/vuejs/vue-jest/tree/master/e2e/3.x
I've added a more minimal reproduction project there, though I don't know if I will have the free time to investigate further due to work commitments
Facing the same here, I'm trying to find out something that could cause this but I not went so far
vue: ^3.2.26
@vue/cli-plugin-unit-jest: ^5.0.0-rc.1
@vue/vue3-jest: ^27.0.0-alpha.4
If anyone wants to take a look at this, it would be great! I'm too busy to look at vue-jest
bugs at this point in time.
for those who are interested: we had the same issue in our project and as workaround we returned to
"vue-jest": "^5.0.0-alpha.10",
for now until this issue is fixed.
Interesting, we should find out the different between the code in v5 and @vue/vue3-jest@27
- they are very similar, it's just between the two, we moved from semantic versioning to matching the Jest version and a monorepo. The actual code is quite similar, so if someone can track down what broke and port it to @vue/vue3-jest@27
, that'd be great.
We had the same issue, switching the reporter to V8 fixed it.
I'm not entirely certain if it's related, but we're seeing 'weird' things in coverage as well. (vue2 + vue-jest) I've gone back in our pipeline and narrowed it down to this upgrade:
Difference in coverage:
Seeing exactly the same with recent version of (vue2 + vue-jest). Vue2 version 4.5.17, Vue-jest version 3.0.7.
After my last comment, we've tried to reconstruct the coverage by downgrading. In the end, we also needed to downgrade @babel/core
to version ^7.16.7
in order to make coverage working again.
So we are now in the situation that coverage is working again but with vue-jest@^3.0.7
and @babel/core@^7.16.7
on Jest 28.
Why don't you just use V8?
Why don't you just use V8?
V8 is incredibly slow on a GitHub Actions runner and runs into OOM errors for large projects
https://github.com/vuejs/vue-jest/pull/423#issuecomment-990940792
Hey,
Is there a date announced for the correction of this bug?
I'm waiting for this fix because on my application I have 100% coverage everywhere and it's really very annoying.
I tried to revert to previous versions and without success.
The update of the lock package following an audit fix was fatal for me
Thx !
Can anyone share a working set of npm packages that gives correct coverage for Vue 2? We were previously using jest@26.6.3
with vue-jest@3.0.7
and upgraded to v28 with @vue/vue2-jest, now our coverage numbers are completely wrong. Jest is showing 1 statement for the entire SFC instead of any methods/computed properties/etc inside the Githubissues.
I have Jest setup to test files with
@vue/vue3-jest
and it runs all of the Vue tests just fine, however I came across a peculiar issue regarding test coverage - it was going down in our CI dashboard as I was testing more components.SFC Vue files without a
*.spec.js
test show up in the Jest coverage summary with zero coverage as expected. After adding a*.spec.js
for a component, it will no longer collect or be listed in the coverage summary in our project.Regular JavaScript files are unaffected and report coverage as expected.
I have a demo repository setup, however it only partially reproduces our issue -
@components/Demo.vue
is missing, but the two components in@components/demo/
show up fine (which doesn't happen in our project). Removing the@components/Demo.spec.js
makes it show up again with zero coverage.Demo: https://github.com/wopian/jest-coverage-demoDemo moved to PR: https://github.com/vuejs/vue-jest/pull/423
With Demo.spec.js, coverage unreported
With Demo.spec.js.old, (zero) coverage reported