-
Notifications
You must be signed in to change notification settings - Fork 267
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 ', () => { | |
const Comp = { | |
template: `<teleport to="body"><div id="content" /></teleport>` | |
} | |
const wrapper = 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-utils
version: 2.2.0Vue
version: 3.2.41node
version: 16.18.0npm
(oryarn
) version: pnpm@7.14.0
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