fix: allow finding async component stubs by definition#2040
Conversation
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
| name: stubName, | ||
| component: type | ||
| component: type, | ||
| registerStub |
There was a problem hiding this comment.
We want to provide an ability to mess with stubs (including async componentS) to the plugin system, so our plugins will be as capable as original createStub
|
A bit of off-topic: happy to be back to active development here! We have a Vue.js 3 migration working group established in GitLab, so I will be happy to dedicate more time polishing things here and adding new cool features |
ba8bbb3 to
0546844
Compare
0546844 to
15fb751
Compare
| })) | ||
|
|
||
| it('stubs async component with name', async () => { | ||
| const AsyncComponent = defineAsyncComponent(async () => ({ |
There was a problem hiding this comment.
We need to move component definition inside test, because otherwise for second test __asyncResolved will be already defined from previous test
lmiller1990
left a comment
There was a problem hiding this comment.
🎉
Will give a bit of time for other reviewers to chime in, but tests look good.
This MR introduces an ability to find async component stubs by definition of underlying component, not just by wrapper itself
It also mimics
@vue/test-utils@1.xbehavior (well, kinda) -@vue/test-utils@1.xwas unable to stub async components due to limitations in our patch approach, so "finding" always worked cause there were no stubs