Skip to content

Commit 439377b

Browse files
committed
chore: remove duplicated test + add missing prop decl
1 parent 3cfe5f9 commit 439377b

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

packages/runtime-core/__tests__/apiLifecycle.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ describe('api: lifecycle hooks', () => {
231231
}
232232

233233
const Mid = {
234+
props: ['count'],
234235
setup(props: any) {
235236
onBeforeMount(() => calls.push('mid onBeforeMount'))
236237
onMounted(() => calls.push('mid onMounted'))
@@ -243,6 +244,7 @@ describe('api: lifecycle hooks', () => {
243244
}
244245

245246
const Child = {
247+
props: ['count'],
246248
setup(props: any) {
247249
onBeforeMount(() => calls.push('child onBeforeMount'))
248250
onMounted(() => calls.push('child onMounted'))

packages/runtime-core/__tests__/apiSetupContext.spec.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -75,39 +75,6 @@ describe('api: setup context', () => {
7575
expect(dummy).toBe(1)
7676
})
7777

78-
it('setup props should resolve the correct types from props object', async () => {
79-
const count = ref(0)
80-
let dummy
81-
82-
const Parent = {
83-
render: () => h(Child, { count: count.value })
84-
}
85-
86-
const Child = defineComponent({
87-
props: {
88-
count: Number
89-
},
90-
91-
setup(props) {
92-
watchEffect(() => {
93-
dummy = props.count
94-
})
95-
return () => h('div', props.count)
96-
}
97-
})
98-
99-
const root = nodeOps.createElement('div')
100-
render(h(Parent), root)
101-
expect(serializeInner(root)).toMatch(`<div>0</div>`)
102-
expect(dummy).toBe(0)
103-
104-
// props should be reactive
105-
count.value++
106-
await nextTick()
107-
expect(serializeInner(root)).toMatch(`<div>1</div>`)
108-
expect(dummy).toBe(1)
109-
})
110-
11178
it('context.attrs', async () => {
11279
const toggle = ref(true)
11380

0 commit comments

Comments
 (0)