Explorar o código

test: fix renderSlot tests

Evan You %!s(int64=5) %!d(string=hai) anos
pai
achega
4e5897d2df
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      packages/runtime-core/__tests__/helpers/renderSlot.spec.ts

+ 9 - 0
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(