test: test for compat mode v3 render fn detection

This commit is contained in:
Evan You 2021-07-16 10:23:25 -04:00
parent 8dbad83e7f
commit b6cc8640c5

View File

@ -236,4 +236,19 @@ describe('compat: render function', () => {
deprecationData[DeprecationTypes.RENDER_FUNCTION].message
).toHaveBeenWarned()
})
test('should detect v3 compiled render fn', () => {
const vm = new Vue({
data() {
return {
a: 'hello'
}
},
// check is arg length based
render(c: any, _c: any) {
return createVNode('div', null, c.a)
}
}).$mount()
expect(vm.$el.outerHTML).toBe(`<div>hello</div>`)
})
})