Skip to content

cy.clock and timers, what to do? cy.tick doesn't trigger them #30754

Open
@glromeo

Description

@glromeo

Current behavior

cy.clock breaks preact hooks and I see that also requestAnimationFrame doesn't work even if I try to add ticks to my tests it never fires

Desired behavior

a more straightforward or at least better documented way of writing tests where clock is controlled and timers are involved

i.e. tell me how to make preact hooks work!

Test code to reproduce

https://github.com/glromeo/cypress-issue-with-preact-hooks

Cypress Version

latest

Node version

lts

Operating System

windows 11 but others as well

Debug Logs

No response

Other

the repo should help understand the problem I am facing
please look at: cypress/e2e/3-preact/current-time.cy.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleno activity on this issue for a long period

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions