We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07fbab1 commit 0991197Copy full SHA for 0991197
src/__tests__/visitor.test.js
@@ -1,3 +1,5 @@
1
+import { JSDOM } from 'jsdom'
2
+
3
import React, {
4
Component,
5
Fragment,
@@ -27,9 +29,8 @@ import {
27
29
28
30
import { visitElement } from '../visitor'
31
-const {
- ReactCurrentDispatcher
32
-} = (React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
+const { ReactCurrentDispatcher } = (React: any)
33
+ .__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
34
35
let prevDispatcher = null
36
@@ -173,6 +174,7 @@ describe('visitElement', () => {
173
174
})
175
176
it('returns nothing for portal components', () => {
177
+ const document = new JSDOM().window.document
178
const portal = createPortal(<Noop />, document.createElement('div'))
179
const children = visitElement(portal, [], () => {})
180
expect(children.length).toBe(0)
0 commit comments