- Notifications
You must be signed in to change notification settings - Fork 278
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
After update from 2.1.0 to 2.2.0, tests with stubs:{teleport: true } produce a warning:
[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance. at <Teleport to="body" > at <Anonymous ref="VTU_COMPONENT" > at <VTUROOT> To Reproduce
Able to reproduce within VTU unit test
test-utils/tests/mountingOptions/global.stubs.spec.ts
Lines 514 to 531 in 6371349
| it('opts in to stubbing teleport ',()=>{ | |
| constComp={ | |
| template: `<teleport to="body"><div id="content" /></teleport>` | |
| } | |
| constwrapper=mount(Comp,{ | |
| global: { | |
| stubs: { | |
| teleport: true | |
| } | |
| } | |
| }) | |
| expect(wrapper.html()).toBe( | |
| '<teleport-stub to="body">\n'+ | |
| ' <div id="content"></div>\n'+ | |
| '</teleport-stub>' | |
| ) | |
| }) |
Expected behavior
Not print a warning
Related information:
@vue/test-utilsversion: 2.2.0Vueversion: 3.2.41nodeversion: 16.18.0npm(oryarn) version: [email protected]
Additional context
I think this might come from the stubs refactoring and some previous special handling on the teleport child nodes, where they have been explicit passed as function:
Line 208 in 30e9c0c
| ()=>children |
gabriellatavares
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working