Replies: 1 comment
-
|
I have no idea what you are asking. You want a future date, but you are afraid that the rest of the code will get frozen dates? Please elaborate on what you want with examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
In my project, there is a case where new Date() should return a future date only in the development environment.
I am thinking of using Sinon for this, but I’m hesitant because using Sinon might freeze the time, which could cause issues when calling new Date() multiple times.
For reference, my project is using:
Next.js (latest) with App Router
TypeScript (latest)
Is there a recommended approach to handle this properly with Sinon in this kind of setup?
Any advice would be appreciated!
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions