]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: add test case edison/fix/12234 12240/head
authordaiwei <daiwei521@126.com>
Wed, 23 Oct 2024 06:24:40 +0000 (14:24 +0800)
committerdaiwei <daiwei521@126.com>
Wed, 23 Oct 2024 06:24:40 +0000 (14:24 +0800)
packages/runtime-core/__tests__/componentProps.spec.ts

index b8eb0e4720874764616e18a9eb73352a61fbc20d..950d9c48de13e080b7dd53f275d05987fe835f99 100644 (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