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
fix: return the correct name when stubbing a script setup
component
#1783
Conversation
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @joeyhuang0235
Can you add a test that checks this change please?
OK, I'll do it later |
@cexbrayat If I want the test case to run expectedly I have to install |
I guess we can, if that solves a specific issue for this plugin. Is it possible to limit the application of this plugin only to the test you are adding? |
I think I can't. As long as a component is imported, the plugin will take effect, so I can't limit the scope of this plugin to a test, but only control the target it transforms. So I specified that it can only transform the AutoImportScriptSetup component |
Ok, it should be good enough. Push your test and we'll take a look 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits, and we're good to merge 👍
You need to run |
Ok, sorry I forgot |
Awesome, thanks @joeyhuang0235 |
When stubbing a component using the
<script setup>
syntax test-utils can't return its name correctly, so it skips the stub and the stub fails.There's an issue that describes the problem.This is because
getComponentName()
function doesn't return its__name
property.