happo / happo-cypress

A Happo integration with Cypress.io
35 stars 4 forks source link

Allow hiding logs when taking a snapshot #111

Closed lworkman closed 4 months ago

lworkman commented 4 months ago

I'm working on cleaning up our logging during Cypress tests, and can't find a way to disable the log from calling cy.task('happoRegisterSnapshot'). It's happening when I take a screenshot via .happoScreenshot, and looking at the source code it appears there's no way to pass down a log: false value:

https://github.com/happo/happo-cypress/blob/4c67374bbd371de02577f842290e9c680fa98e85/index.js#L83C14-L90

cy.task does allow hiding of logs, so there's nothing stopping the log from respecting a log: false argument. Ideally happoScreenshot would just pass down its own log value.

Is there anyway this can be added?

trotzig commented 4 months ago

Thanks for the report @lworkman! I'm working on a fix for this right away.

trotzig commented 4 months ago

A fix for this was released in version 4.2.0. 🚀

https://github.com/happo/happo-cypress/releases/tag/v4.2.0

trotzig commented 4 months ago

Documentation is also updated, here: https://docs.happo.io/docs/cypress#passing-along-options

lworkman commented 4 months ago

Thanks for the quick turnaround @trotzig!