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 {
11
11
transformVNodeArgs
12
12
} from '../src/vnode'
13
13
import { Data } from '../src/component'
14
- import { ShapeFlags , PatchFlags } from '@vue/shared'
14
+ import { ShapeFlags , PatchFlags , mockWarn } from '@vue/shared'
15
15
import { h , reactive , isReactive } from '../src'
16
16
import { createApp , nodeOps , serializeInner } from '@vue/runtime-test'
17
17
import { setCurrentRenderingInstance } from '../src/componentRenderUtils'
18
18
19
19
describe ( 'vnode' , ( ) => {
20
+ mockWarn ( )
21
+
20
22
test ( 'create with just tag' , ( ) => {
21
23
const vnode = createVNode ( 'p' )
22
24
expect ( vnode . type ) . toBe ( 'p' )
@@ -62,6 +64,7 @@ describe('vnode', () => {
62
64
}
63
65
expect ( createVNode ( 'div' ) . key ) . toBe ( null )
64
66
expect ( createVNode ( 'div' , { key : undefined } ) . key ) . toBe ( null )
67
+ expect ( `VNode created with invalid key (NaN)` ) . toHaveBeenWarned ( )
65
68
} )
66
69
67
70
test ( 'create with class component' , ( ) => {
You can’t perform that action at this time.
0 commit comments