2
0
daiwei 1 жил өмнө
parent
commit
8e6a77db47

+ 5 - 0
packages/runtime-core/__tests__/componentProps.spec.ts

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