]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(types): also test Object as PropType casting
authorEvan You <yyx990803@gmail.com>
Fri, 3 Apr 2020 13:29:21 +0000 (09:29 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 3 Apr 2020 13:29:21 +0000 (09:29 -0400)
test-dts/defineComponent.test-d.tsx

index 6838e6db2fc365406c480730cc36f886f0b8e3db..07ee8dcc00014d9b2311fdef92909fb1226dad51 100644 (file)
@@ -15,7 +15,7 @@ describe('with object props', () => {
     e?: Function
     bb: string
     cc?: string[] | undefined
-    dd: string[]
+    dd: { n: 1 }
     ee?: () => string
     ff?: (a: number, b: string) => { a: boolean }
     ccc?: string[] | undefined
@@ -43,7 +43,7 @@ describe('with object props', () => {
       cc: Array as PropType<string[]>,
       // required + type casting
       dd: {
-        type: Array as PropType<string[]>,
+        type: Object as PropType<{ n: 1 }>,
         required: true
       },
       // return type
@@ -152,7 +152,7 @@ describe('with object props', () => {
       bb="bb"
       e={() => {}}
       cc={['cc']}
-      dd={['dd']}
+      dd={{ n: 1 }}
       ee={() => 'ee'}
       ccc={['ccc']}
       ddd={['ddd']}