Skip to content

Convert Date to number when using cy.clock #7786

Closed
@bahmutov

Description

@bahmutov
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

Activity

bahmutov

bahmutov commented on Jun 23, 2020

@bahmutov
ContributorAuthor

Related issue bahmutov/sudoku#10

added
stage: needs reviewThe PR code is done & tested, needs review
and removed on Jul 16, 2020
cypress-bot

cypress-bot commented on Jul 17, 2020

@cypress-bot
Contributor

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 commented on Jul 21, 2020

@cypress-bot
Contributor

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.

locked as resolved and limited conversation to collaborators on Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg/driverThis is due to an issue in the packages/driver directorytype: unexpected behaviorUser expected result, but got another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jennifer-shehane@bahmutov

      Issue actions

        Convert Date to number when using cy.clock · Issue #7786 · cypress-io/cypress