Skip to content

Commit d159033

Browse files
committed
Fix tests for React 17
1 parent 323b145 commit d159033

File tree

5 files changed

+28210
-1246
lines changed

5 files changed

+28210
-1246
lines changed

jest/setup.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'react-native'
22
import 'jest-enzyme'
3-
// import 'react-native-mock-render/mock'
43
import Enzyme from 'enzyme'
54
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'
65

@@ -48,9 +47,7 @@ const jsdom = new JSDOM('<!doctype html><html><body></body></html>', {
4847
url: 'http://localhost',
4948
})
5049

51-
const {
52-
window: { document },
53-
} = jsdom
50+
const { window } = jsdom
5451

5552
function copyProps(src, target) {
5653
Object.defineProperties(target, {
@@ -62,8 +59,8 @@ function copyProps(src, target) {
6259
global.__TEST__ = true
6360
global.fetch = require('jest-fetch-mock')
6461
global.fetchMock = global.fetch
65-
global.document = document
66-
global.window = document.defaultView
62+
global.document = window.document
63+
global.window = window
6764
global.navigator = {
6865
userAgent: 'node.js',
6966
}

0 commit comments

Comments
 (0)