This repository was archived by the owner on Mar 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 33 "viewportHeight" : 100 ,
44 "video" : false ,
55 "projectId" : " z9dxah" ,
6-
6+ "mountMode" : true ,
77 "ignoreTestFiles" : " *.css" ,
88 "env" : {
99 "cypress-react-unit-test" : {
Original file line number Diff line number Diff line change @@ -20,14 +20,11 @@ const setAlert = w => {
2020function renderTestingPlatform ( ) {
2121 cy . log ( "Prepearing to ReactDOM rendering" ) ;
2222
23- const document = cy . state ( "document" ) ;
24- document . write `
25- <head>
26- <meta charset="utf-8">
27- </head>
28- <body>
29- <div id="cypress-jsdom"></div>
30- </body>` ;
23+ const document = cy . state ( 'document' )
24+
25+ const rootNode = document . createElement ( "div" ) ;
26+ rootNode . setAttribute ( "id" , "cypress-jsdom" ) ;
27+ document . getElementsByTagName ( "body" ) [ 0 ] . prepend ( rootNode ) ;
3128
3229 return cy . get ( "#cypress-jsdom" , { log : false } ) ;
3330}
@@ -64,7 +61,7 @@ interface MountOptions {
6461 ```
6562 **/
6663export const mount = ( jsx : React . ReactElement , options : MountOptions = { } ) => {
67- // checkMountModeEnabled();
64+ checkMountModeEnabled ( ) ;
6865
6966 // Get the display name property via the component constructor
7067 // @ts -ignore FIXME
You can’t perform that action at this time.
0 commit comments