]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: remove duplicated test + add missing prop decl
authorEvan You <yyx990803@gmail.com>
Sat, 28 May 2022 08:17:19 +0000 (16:17 +0800)
committerEvan You <yyx990803@gmail.com>
Sat, 28 May 2022 08:17:19 +0000 (16:17 +0800)
packages/runtime-core/__tests__/apiLifecycle.spec.ts
packages/runtime-core/__tests__/apiSetupContext.spec.ts

index 60a7f7d0cce3540f650d5a62f255c431225bbd2a..4c27ada55c408e7099005b7c00bf06009e7f92d4 100644 (file)
@@ -231,6 +231,7 @@ describe('api: lifecycle hooks', () => {
     }
 
     const Mid = {
+      props: ['count'],
       setup(props: any) {
         onBeforeMount(() => calls.push('mid onBeforeMount'))
         onMounted(() => calls.push('mid onMounted'))
@@ -243,6 +244,7 @@ describe('api: lifecycle hooks', () => {
     }
 
     const Child = {
+      props: ['count'],
       setup(props: any) {
         onBeforeMount(() => calls.push('child onBeforeMount'))
         onMounted(() => calls.push('child onMounted'))
index eea75ac93a27b92068588f88a60450adf78b36fa..f00abc9c1c83d8e9d72422599b503b7f6fd27ea2 100644 (file)
@@ -75,39 +75,6 @@ describe('api: setup context', () => {
     expect(dummy).toBe(1)
   })
 
-  it('setup props should resolve the correct types from props object', async () => {
-    const count = ref(0)
-    let dummy
-
-    const Parent = {
-      render: () => h(Child, { count: count.value })
-    }
-
-    const Child = defineComponent({
-      props: {
-        count: Number
-      },
-
-      setup(props) {
-        watchEffect(() => {
-          dummy = props.count
-        })
-        return () => h('div', props.count)
-      }
-    })
-
-    const root = nodeOps.createElement('div')
-    render(h(Parent), root)
-    expect(serializeInner(root)).toMatch(`<div>0</div>`)
-    expect(dummy).toBe(0)
-
-    // props should be reactive
-    count.value++
-    await nextTick()
-    expect(serializeInner(root)).toMatch(`<div>1</div>`)
-    expect(dummy).toBe(1)
-  })
-
   it('context.attrs', async () => {
     const toggle = ref(true)