Skip to content

Commit af0629c

Browse files
gebilaoxiongyyx990803
authored andcommitted
add test
1 parent c3831c3 commit af0629c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/features/options/functional.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Vue from 'vue'
2+
import { createEmptyVNode } from 'core/vdom/vnode'
23

34
describe('Options functional', () => {
45
it('should work', done => {
@@ -167,4 +168,21 @@ describe('Options functional', () => {
167168
vm.$destroy()
168169
}).then(done)
169170
})
171+
172+
it('create empty vnode when render return null', () => {
173+
const child = {
174+
functional: true,
175+
render () {
176+
return null
177+
}
178+
}
179+
const vm = new Vue({
180+
components: {
181+
child
182+
}
183+
})
184+
const h = vm.$createElement
185+
const vnode = h('child')
186+
expect(vnode).toEqual(createEmptyVNode())
187+
})
170188
})

0 commit comments

Comments
 (0)