From: Evan You Date: Sat, 28 May 2022 08:17:19 +0000 (+0800) Subject: chore: remove duplicated test + add missing prop decl X-Git-Tag: v3.2.37~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=439377b220deb7d8bdbdf08ba295a743db3b1d42;p=thirdparty%2Fvuejs%2Fcore.git chore: remove duplicated test + add missing prop decl --- diff --git a/packages/runtime-core/__tests__/apiLifecycle.spec.ts b/packages/runtime-core/__tests__/apiLifecycle.spec.ts index 60a7f7d0cc..4c27ada55c 100644 --- a/packages/runtime-core/__tests__/apiLifecycle.spec.ts +++ b/packages/runtime-core/__tests__/apiLifecycle.spec.ts @@ -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')) diff --git a/packages/runtime-core/__tests__/apiSetupContext.spec.ts b/packages/runtime-core/__tests__/apiSetupContext.spec.ts index eea75ac93a..f00abc9c1c 100644 --- a/packages/runtime-core/__tests__/apiSetupContext.spec.ts +++ b/packages/runtime-core/__tests__/apiSetupContext.spec.ts @@ -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(`
0
`) - expect(dummy).toBe(0) - - // props should be reactive - count.value++ - await nextTick() - expect(serializeInner(root)).toMatch(`
1
`) - expect(dummy).toBe(1) - }) - it('context.attrs', async () => { const toggle = ref(true)