From 8e6a77db47c228550316188a48d68a3edab74ae5 Mon Sep 17 00:00:00 2001 From: daiwei Date: Wed, 23 Oct 2024 14:24:40 +0800 Subject: [PATCH] test: add test case --- packages/runtime-core/__tests__/componentProps.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/runtime-core/__tests__/componentProps.spec.ts b/packages/runtime-core/__tests__/componentProps.spec.ts index b8eb0e472..950d9c48d 100644 --- a/packages/runtime-core/__tests__/componentProps.spec.ts +++ b/packages/runtime-core/__tests__/componentProps.spec.ts @@ -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