Closed renansoares closed 1 year ago
Just to clarify this is for Vue 2 (not Vue 3)? That's the PR you've submitted.
Hi!
It is possible to do the same fix for Vue3 ? We have the same issue
Thanks !
@quienti sure thing, would you like to make a PR similar to #536?
I don't have much time to work on vue-jest nowadays, but I can help by reviewing, merging and releasing new versions. I hope we can find a maintainer with more bandwidth sometime.
@lmiller1990 I tried to do this => https://github.com/vuejs/vue-jest/pull/541
I don't know if it will work :/
This issue can be closed
Hi,
I have been having an issue with my tests when testing components that have two script tags in the same
vue
file.For example, this component:
Is throwing this error:
I did some tests debugging the implementation of the output from the
process.js
file. That's what I got:The
const test
defined in the script setup was added twice to the final output leading the test to fail because of the error above.I figure out that changing the implementation of
scriptResult
andscriptSetupResult
in theprocess.js
file to the following, made my tests to run again:From my understanding, when there is a
script setup
, it is adding all the code of the normalsetup
twice. Only adding thescriptSetup
in case of not having ascriptSetupResult
seems to solve the issue.This issue is blocking the migration to Jest 19 and consequently to test our script setup components.
Could I help on this? I'm happy to create a merge request if my fix sounds a good one.