Repository navigation
fix: render globally registered components stubbed with false when nested - #3042
Merged
cexbrayat merged 1 commit intoNov 23, 2026
Merged
Conversation
👷 Deploy request for vue-test-utils-docs pending review.Visit the deploys page to approve it
|
commit: |
cexbrayat
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
global.components+stubs: { X: false }only un-stubsXin the mounted component. In any child,Xrenders<!---->with "Component is missing template or render function", inmountandshallowMount, from mounting options orconfig.global.This is the
RouterLink: falsetoggle #504 was added for (vue-router-mock putsRouterLinkinconfig.global.componentsand stubs it withtrue). It only works for a<router-link>in the root component.#504 skipped registration when the stub value was truthy. #816, a types-only change, switched to
key in global.stubs, so forfalseonly the{ name }placeholder gets registered. The root still works becauseglobal.componentsis merged into its local components. This goes back to checking the value.A kebab-case key in
stubs('global-component': false) still resolves to the placeholder registered under that name; that is the separate placeholder loop, so I left it out of this PR.Real-world workaround: https://github.com/Sacane/JManager/blob/4c538519ada78809aa509898a1a13be047c4e10a/client/components/NewPasswordFields.vue#L1-L5 (setup: https://github.com/Sacane/JManager/blob/4c538519ada78809aa509898a1a13be047c4e10a/client/tests/setup.ts#L218-L242)
Playground (2.6.0): https://play.vuejs.org/#eNp9U01v2zAM/SuEMEAy4MjBDhtgxFmHYthlp7Y7RQHqJGzsVpYEfTgdPP/3QXK9BFmxk02+58dH0hzIV2N4H5CUZOX2tjUeHPpg1kK1ndHWwwAWn3JocrDotOzxVndGK1QeRniyugPaB6QX/E6HC/CmD1h4dH4RfCsdFUqovVbOgw4eqqjOqA1KterIOafZDH+XelfLc7UqWVEHtCWwDKo1NIwe2p7mQCcuzWAUqihmpw5WVyJr2P0CVXeYg2xfEGrw2BlZe4RWQQ0KnccD7Gf+7OW2aeXhXQfXQ2H0qiTNkqtJ507r/zayaVgqlW3TR0I59A9thzp4NlEHoQAmsVNtlYMKNttzTp+gSq9aIo+EGZpjqIBxzusklhS4Ca5h99626sjqzXKbZRc1bG0MWqimrbLYQD6ZADimTss5hPPcXAnDPwsc85nnfNi9RynhqZYOY+uRlh5j9k4L+hSTOnje1zIgVPB49+3+548HaHwnqw/Dm28eQ5aN8Bs8vvpKkDMUEywbBQGGrwb3cfGCTI4EyeD3NJ4olsYkUR19A1+m9Ga55U62e2TLHD4vMyiBKq2Qjo9CRc+rYrqndVzjav7N1tH3ylhcD0M6gHFcFTGMH1yQSE6me1p0teHPTitSkjRn8QY4Qf5OXpCrK4uYII33xpVFEZR5OfK97oor2s1H/okvi0PrfNEHXJwRjq5b7Kw+ObT82QmSViHUSMY/O+1t+g==