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

Fix: Use defaultName when it exists to correctly stub async components #1136

Merged
merged 4 commits into from Dec 12, 2021

Conversation

Evertvdw
Copy link
Contributor

@Evertvdw Evertvdw commented Dec 7, 2021

When mounting a component that has components defined with defineAsyncComponent the result of type.name is AsyncComponentWrapper. The defaultName contains the filename which should get precedence over the type.name to make stubbing work correctly.

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

@xanf is that OK with you, as you changed this recently?

tests/components/ScriptSetupWithChildren.vue Outdated Show resolved Hide resolved
@Evertvdw
Copy link
Contributor Author

Evertvdw commented Dec 7, 2021

@cexbrayat I just ran yarn run lint in the project in my branch but that has 100+ warnings. Seemed to also be indicated here: https://github.com/vuejs/vue-test-utils-next/runs/4445921989?check_suite_focus=true. Is that something I need to fix because I did not change anything in those files :)

@cexbrayat
Copy link
Member

@Evertvdw It looks like it fails in files you updated (tests/components/ScriptSetupWithChildren.vue). Run yarn lint:fix and you should be good to go. If you have other errors, make sure you have up-to-date dependencies, as it should not be the case?

@Evertvdw
Copy link
Contributor Author

Evertvdw commented Dec 7, 2021

Probably some git glitch, I ran the lint:fix and git changes said 105 changed files, but when comparing there were no differences for 104 out of 105. Fixed the one error that was there though :)

@lmiller1990 lmiller1990 merged commit 4108a43 into vuejs:master Dec 12, 2021
@Evertvdw Evertvdw deleted the async-component-stub branch December 13, 2021 07:37
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

Successfully merging this pull request may close these issues.

None yet

4 participants