Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 9d17877

Browse files
committed
fix: refactor how the log is done
1 parent 8facc70 commit 9d17877

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

lib/index.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,23 @@ Cypress.Commands.add('copyComponentStyles', component => {
101101
export 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

121138
Cypress.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
})

0 commit comments

Comments
 (0)