test(runtime-core): show warn when create with invalid type (#2128)
This commit is contained in:
parent
692197be33
commit
1cc8cd60a1
@ -42,6 +42,12 @@ describe('vnode', () => {
|
|||||||
expect(vnode.props).toBe(null)
|
expect(vnode.props).toBe(null)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('show warn when create with invalid type', () => {
|
||||||
|
const vnode = createVNode('')
|
||||||
|
expect('Invalid vnode type when creating vnode').toHaveBeenWarned()
|
||||||
|
expect(vnode.type).toBe(Comment)
|
||||||
|
})
|
||||||
|
|
||||||
test('create from an existing vnode', () => {
|
test('create from an existing vnode', () => {
|
||||||
const vnode1 = createVNode('p', { id: 'foo' })
|
const vnode1 = createVNode('p', { id: 'foo' })
|
||||||
const vnode2 = createVNode(vnode1, { class: 'bar' }, 'baz')
|
const vnode2 = createVNode(vnode1, { class: 'bar' }, 'baz')
|
||||||
|
Loading…
Reference in New Issue
Block a user