Skip to content

Commit 28407b2

Browse files
committed
chore: fix tests
1 parent 4eecd66 commit 28407b2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/setupContext.spec.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ describe('setupContext', () => {
2222

2323
expect(context).toBeDefined()
2424
expect('parent' in context).toBe(true)
25-
expect(context.root).toBe(vm.$root)
26-
expect(context.parent).toBe(vm.$parent)
2725
expect(context.slots).toBeDefined()
2826
expect(context.attrs).toEqual(vm.$attrs)
29-
expect(context.listeners).toBe(vm.$listeners)
3027

31-
// CAUTION: this will be removed in 3.0
32-
// @ts-expect-error
28+
// CAUTION: these will be removed in 3.0
29+
expect(context.root).toBe(vm.$root)
30+
expect(context.parent).toBe(vm.$parent)
31+
expect(context.listeners).toBe(vm.$listeners)
3332
expect(context.refs).toBe(vm.$refs)
3433
expect(typeof context.emit === 'function').toBe(true)
3534
})
@@ -51,7 +50,7 @@ describe('setupContext', () => {
5150
test: defineComponent({
5251
setup(_, { slots }) {
5352
return () => {
54-
return h('div', [slots.default(), slots.item()])
53+
return h('div', [slots.default?.(), slots.item?.()])
5554
}
5655
},
5756
}),
@@ -78,7 +77,7 @@ describe('setupContext', () => {
7877
components: {
7978
test: {
8079
setup(_, { slots }) {
81-
slots.default()
80+
slots.default?.()
8281
},
8382
},
8483
},

0 commit comments

Comments
 (0)