File tree Expand file tree Collapse file tree 9 files changed +229
-475
lines changed
Expand file tree Collapse file tree 9 files changed +229
-475
lines changed Original file line number Diff line number Diff line change 9797 "webpack-cli" : " ^4.9.2"
9898 },
9999 "jest" : {
100- "setupFiles " : [
100+ "setupFilesAfterEnv " : [
101101 " <rootDir>/tests/.setup.js"
102102 ],
103- "snapshotSerializers" : [
104- " enzyme-to-json/serializer"
105- ],
106103 "roots" : [
107104 " <rootDir>/tests"
108105 ],
Original file line number Diff line number Diff line change 1- const jsdom = require ( 'jsdom' ) ;
1+ // Importing this here makes it work everywhere.
2+ import '@testing-library/jest-dom' ;
23
3- const documentHTML = '<!doctype html><html><body><div id="root"></div></body></html>' ;
4- const dom = new jsdom . JSDOM ( documentHTML ) ;
5- global . document = dom . window . document ;
6- global . window = dom . window ;
7- global . window . resizeTo = ( width , height ) => {
8- global . window . innerWidth = width || global . window . innerWidth ;
9- global . window . innerHeight = width || global . window . innerHeight ;
10- global . window . dispatchEvent ( new Event ( 'resize' ) ) ;
4+ window . resizeTo = ( width , height ) => {
5+ window . innerWidth = width || window . innerWidth ;
6+ window . innerHeight = width || window . innerHeight ;
7+ window . dispatchEvent ( new Event ( 'resize' ) ) ;
118} ;
12- global . window . requestAnimationFrame = jest . fn ( ) ;
13-
14- const Enzyme = require ( 'enzyme' ) ;
15- const Adapter = require ( '@wojtekmaj/enzyme-adapter-react-17' ) ;
16-
17- Enzyme . configure ( { adapter : new Adapter ( ) } ) ;
You can’t perform that action at this time.
0 commit comments