From 4e5897d2df02b14cc39488b902fa00e8d5518e7c Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 13 Jul 2021 10:52:15 -0400 Subject: [PATCH] test: fix renderSlot tests --- .../runtime-core/__tests__/helpers/renderSlot.spec.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts index 14d20f13..9af91ce1 100644 --- a/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts +++ b/packages/runtime-core/__tests__/helpers/renderSlot.spec.ts @@ -10,8 +10,17 @@ import { Slot } from '../../src' import { PatchFlags } from '@vue/shared' +import { setCurrentRenderingInstance } from '../../src/componentRenderContext' describe('renderSlot', () => { + beforeEach(() => { + setCurrentRenderingInstance({ type: {} } as any) + }) + + afterEach(() => { + setCurrentRenderingInstance(null) + }) + it('should render slot', () => { let child const vnode = renderSlot(