-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
Description
Version
1.0.0-beta.18
Reproduction link
https://codesandbox.io/s/0mrvjmvk6l
Steps to reproduce
Hi there, so Iβm building a library for work and Iβm using the render function and only accepting default scoped slots. I have the render function currently defined as
render() {
return this.$scopedSlots.default({ ...this.computedStateAndHelpers })
},
When I try to write tests for it (using jest) I always get an error when trying to mount the component
const wrapper = shallowMount(Component, {
scopedSlots: {
default: () => '<p></p>'
}
})
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.name()).toBe('component-name')
I also tried
const wrapper = shallowMount(Component, {
scopedSlots: {
default: '<p></p>'
}
})
expect(wrapper.isVueInstance()).toBe(true)
expect(wrapper.name()).toBe('component-name')
The error is
scopedSlots[key].trim is not a function
I don't know what I'm doing wrong, can someone please help me figure this out?
What is expected?
Expecting the test to pass
What is actually happening?
The error is
scopedSlots[key].trim is not a function
grandynguyen, davestaab, aweber1, wcycode, gponsu and 2 more