File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/runtime-core/__tests__ Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,14 @@ import {
1111 transformVNodeArgs
1212} from '../src/vnode'
1313import { Data } from '../src/component'
14- import { ShapeFlags , PatchFlags } from '@vue/shared'
14+ import { ShapeFlags , PatchFlags , mockWarn } from '@vue/shared'
1515import { h , reactive , isReactive } from '../src'
1616import { createApp , nodeOps , serializeInner } from '@vue/runtime-test'
1717import { setCurrentRenderingInstance } from '../src/componentRenderUtils'
1818
1919describe ( 'vnode' , ( ) => {
20+ mockWarn ( )
21+
2022 test ( 'create with just tag' , ( ) => {
2123 const vnode = createVNode ( 'p' )
2224 expect ( vnode . type ) . toBe ( 'p' )
@@ -62,6 +64,7 @@ describe('vnode', () => {
6264 }
6365 expect ( createVNode ( 'div' ) . key ) . toBe ( null )
6466 expect ( createVNode ( 'div' , { key : undefined } ) . key ) . toBe ( null )
67+ expect ( `VNode created with invalid key (NaN)` ) . toHaveBeenWarned ( )
6568 } )
6669
6770 test ( 'create with class component' , ( ) => {
You can’t perform that action at this time.
0 commit comments