question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allow disable of DOM snapshots for stubs and spies

See original GitHub issue

I use a lot of spies and stubs, and don’t need a DOM snapshot every time a spied function is called, since a DOM snapshot is memory/CPU intensive

We should be able to disable the snapshot similar to how we can disable the log:

cy.stub().log(false)
cy.stub().snapshot(false)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kucebcommented, Apr 29, 2019

@jennifer-shehane .log chained off of a cypress stub/spy sets whether the stub will log or not. We do this because you cannot pass an options object to cy.stub() (theres no good way to know whats the options object and whats the stub subject)

maybe simply support a .options([..options]) method on a stub/spy instance to set the options.

here’s where we create the .log function on a stub/spy https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/commands/agents.coffee#L187

0reactions
cypress-bot[bot]commented, Aug 20, 2020

Released in 5.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v5.0.0, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interacting with Elements - Cypress Documentation
Cypress will watch the DOM - re-running the queries that yielded the current subject ... Cypress checks whether an element's disabled property is...
Read more >
Best Practices for Spies, Stubs and Mocks in Sinon.js
In this article, we'll show you the differences between spies, stubs and mocks, when and how to use them, and give you a...
Read more >
Testing React components - Untitled Kingdom
Often we don't even want to touch the DOM and generate HTML as it doesn't make ... of all the spies and stubs...
Read more >
ES6 Class Mocks - Jest
Again, this allows you to inject different behavior for testing, but does not provide a way to spy on calls. * Module factory...
Read more >
Cypress - Code Like This
If you want to temporarily enable or disable tests, you can use only or skip ... Cypress saves DOM snapshots for every command,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found