test: add test case

This commit is contained in:
daiwei 2024-10-23 14:24:40 +08:00
parent 4ff11301ed
commit 8e6a77db47
1 changed files with 5 additions and 0 deletions

View File

@ -413,6 +413,7 @@ describe('component props', () => {
fn: { type: Function },
skipCheck: { type: [Boolean, Function], skipCheck: true },
empty: { type: [] },
foo: { type: Boolean },
},
setup() {
return () => null
@ -429,6 +430,7 @@ describe('component props', () => {
fn: true,
skipCheck: 'foo',
empty: [1, 2, 3],
foo: Symbol(),
}),
nodeOps.createElement('div'),
)
@ -459,6 +461,9 @@ describe('component props', () => {
expect(
`Prop type [] for prop "empty" won't match anything. Did you mean to use type Array instead?`,
).toHaveBeenWarned()
expect(
`[Vue warn]: Invalid prop: type check failed for prop "foo". Expected Boolean, got Symbol`,
).toHaveBeenWarned()
})
// #3495