Skip to content

Expose shouldAdvanceTime option from @sinonjs/fake-timersΒ #27744

Open
@Yihao-G

Description

@Yihao-G

What would you like?

I would like to set shouldAdvanceTime to true when calling cy.clock() so the time automatically flows rather than stopped/frozen.

Why is this needed?

I have a page that will only do something after a set time, but before that, the page also has some other components that rely on the elapse of time (because of the use of setTimeout/setInterval). I don't want to call cy.tick for a random duration because I want to test a specific behaviour that happens after the time I specified.

Other

Related StackOverflow question and answer (and also shows some other use cases): https://stackoverflow.com/questions/75419850/how-to-set-initial-time-in-cypress-and-allow-time-to-flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingtype: featureNew feature that does not currently exist

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions