Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set the context when overwriting .clock command #19158

Merged
merged 3 commits into from
Dec 2, 2021

Conversation

Hugo-Hache
Copy link
Contributor

@Hugo-Hache Hugo-Hache commented Nov 30, 2021

User facing changelog

Previously overwriting .clock command crashed because it did not preserve this context. Now the following works:

Cypress.Commands.overwrite('clock', (originalCommand, ...args) => {
  return originalCommand(...args)
})

cy.clock()

Additional details

This MR is vastly inspired from #9589

PR Tasks

  • Have tests been added/updated?
  • Has the original issue or this PR been tagged with a release in ZenHub?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation? Link
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@Hugo-Hache Hugo-Hache requested a review from a team as a code owner November 30, 2021 15:21
@Hugo-Hache Hugo-Hache requested review from jennifer-shehane and ryanthemanuel and removed request for a team November 30, 2021 15:21
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 30, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Nov 30, 2021

CLA assistant check
All committers have signed the CLA.

@Hugo-Hache
Copy link
Contributor Author

Thanks @bahmutov for #9589, without it I would never have been able to know how to fix the crash I was facing.

@jennifer-shehane jennifer-shehane removed their request for review December 1, 2021 16:07
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Dec 1, 2021

@Hugo-Hache Thanks for signing the CLA, unfortunately one of the authors of the commits does not match the email address on your GitHub account. Our CLA bot gets confused when they don't match. Here are some solutions to fixing when commits are linked to the wrong user: https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/

Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update CLA signature

@flotwig flotwig self-requested a review December 1, 2021 16:37
@Hugo-Hache
Copy link
Contributor Author

Hugo-Hache commented Dec 1, 2021

@jennifer-shehane I just fixed the identity of my first commit to match my GitHub account. Thanks for the notice.

@jennifer-shehane jennifer-shehane dismissed their stale review December 2, 2021 16:29

Dismissing my review

@flotwig flotwig merged commit 4630ef4 into cypress-io:develop Dec 2, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 4, 2021

Released in 9.1.1.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants