This repository was archived by the owner on Mar 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,23 @@ Cypress.Commands.add('copyComponentStyles', component => {
101101export const mount = ( jsx , alias ) => {
102102 // Get the display name property via the component constructor
103103 const displayname = alias || jsx . type . prototype . constructor . name
104+
105+ let cmd
106+
104107 cy . injectReactDOM ( )
105- . log ( `ReactDOM.render(<${ displayname } ... />)` , jsx . props )
106108 . window ( { log : false } )
109+ . then ( ( ) => {
110+ cmd = Cypress . log ( {
111+ name : 'mount' ,
112+ // @ts -ignore
113+ message : [ `ReactDOM.render(<${ displayname } ... />)` ] ,
114+ consoleProps ( ) {
115+ return {
116+ props : jsx . props
117+ }
118+ }
119+ } )
120+ } )
107121 . then ( setXMLHttpRequest )
108122 . then ( setAlert )
109123 . then ( win => {
@@ -116,6 +130,9 @@ export const mount = (jsx, alias) => {
116130 cy . wrap ( component , { log : false } ) . as ( displayname )
117131 } )
118132 cy . copyComponentStyles ( jsx )
133+ . then ( ( ) => {
134+ cmd . snapshot ( ) . end ( )
135+ } )
119136}
120137
121138Cypress . Commands . add ( 'mount' , mount )
@@ -174,8 +191,7 @@ before(() => {
174191 cy . log ( 'Initializing UMD module cache' ) . then ( ( ) => {
175192 for ( const module of moduleNames ) {
176193 let { name, type, location } = module
177- cy . log ( `Loading ${ name } via ${ type } ` )
178- . readFile ( location )
194+ cy . readFile ( location , { log :false } )
179195 . then ( source => Cypress . modules . push ( { name, type, location, source } ) )
180196 }
181197 } )
You can’t perform that action at this time.
0 commit comments