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

Convert Date to number when using cy.clock #7786

Closed
bahmutov opened this issue Jun 23, 2020 · 3 comments · Fixed by #7789
Closed

Convert Date to number when using cy.clock #7786

bahmutov opened this issue Jun 23, 2020 · 3 comments · Fixed by #7789
Labels
pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another

Comments

@bahmutov
Copy link
Contributor

Cypress v4.8.0

When mocking clock with cy.clock we can pass "now" argument. But it is silently ignored if it is a Date

cy.clock(new Date()) // nope
cy.clock(+ new Date()) // yep, current date

When passing Date object and clicking on the clock command

Screen Shot 2020-06-23 at 8 48 09 AM

@bahmutov
Copy link
Contributor Author

Related issue bahmutov/sudoku#10

@bahmutov bahmutov added the type: unexpected behavior User expected result, but got another label Jun 23, 2020
@cypress-bot cypress-bot bot added the stage: proposal 💡 No work has been done of this issue label Jun 23, 2020
@jennifer-shehane jennifer-shehane added the pkg/driver This is due to an issue in the packages/driver directory label Jun 23, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: proposal 💡 No work has been done of this issue labels Jul 16, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 17, 2020

The code for this is done in cypress-io/cypress#7789, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jul 17, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 21, 2020

Released in 4.11.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/driver This is due to an issue in the packages/driver directory type: unexpected behavior User expected result, but got another
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants