-
Notifications
You must be signed in to change notification settings - Fork 156
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
Issue with script and script setup in the same vue file #535
Comments
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 ? Thanks ! |
@lmiller1990 I tried to do this => #541 I don't know if it will work :/ |
This issue can be closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: