From: edison Date: Tue, 13 Oct 2020 19:27:21 +0000 (+0800) Subject: test(runtime-core): show warn when create with invalid type (#2128) X-Git-Tag: v3.0.1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cc8cd60a11cab7b75a3f3cda44bb6f157616e5b;p=thirdparty%2Fvuejs%2Fcore.git test(runtime-core): show warn when create with invalid type (#2128) --- diff --git a/packages/runtime-core/__tests__/vnode.spec.ts b/packages/runtime-core/__tests__/vnode.spec.ts index 09d7f54cea..5bfde8e597 100644 --- a/packages/runtime-core/__tests__/vnode.spec.ts +++ b/packages/runtime-core/__tests__/vnode.spec.ts @@ -42,6 +42,12 @@ describe('vnode', () => { 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', () => { const vnode1 = createVNode('p', { id: 'foo' }) const vnode2 = createVNode(vnode1, { class: 'bar' }, 'baz')