You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I mock the current date with cy.clock(), and then I call it again later in my test, the current date will not be changed and new invocations of new Date() will return my old mocked date.
Additionally, the second cy.clock call is not even shown in the log
Current behavior
If I mock the current date with cy.clock(), and then I call it again later in my test, the current date will not be changed and new invocations of
new Date()
will return my old mocked date.Additionally, the second
cy.clock
call is not even shown in the logDesired behavior
Something like this should work:
Test code to reproduce
https://github.com/Lehren/cypress-test-tiny
Cypress Version
13.7.2
Node version
v16.20.2
Operating System
macOS 14.3.1
Debug Logs
No response
Other
Cypress test:
![Screenshot 2024-04-10 at 16 05 23](https://private-user-images.githubusercontent.com/8881212/321268106-bf8f7a0f-bc6c-4443-8f2d-4613acbc5bcc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0MjMzODAsIm5iZiI6MTcxODQyMzA4MCwicGF0aCI6Ii84ODgxMjEyLzMyMTI2ODEwNi1iZjhmN2EwZi1iYzZjLTQ0NDMtOGYyZC00NjEzYWNiYzViY2MucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MTVUMDM0NDQwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTIwYjJkYjEwYjE0NzNjNThhMTFhYjc5ZWEzMGZmZjM4YjU5NWQzZWYzNWMzYzEyMTRhYWZiNDJlZWViOWZhZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.P6YCB-tDhO_3O__b7sMIMyFhCLvn7I7QkOIoVC1hkDE)
Cypress testlog :
Note, no second
clock
callThe text was updated successfully, but these errors were encountered: