Closed Twiggeh closed 5 days ago
I am not sure what you mean with your example, I don't understand how it is related to time. Are you doing API testing? Does your request contain information about time? Please be more specific.
Closing because we lack the information to act on this issue. If you can provide more details, please file a new issue by filling the "Feature Request" template, and link to this one.
🚀 Feature Request
The clock should also be able to install into a test and control the timers for said test (not just the code that is being tested).
Example
*.test.js
Motivation
When testing e.g. a fetcher library with deduplication & caching, I need time sensitive controls. It would make life easier to have those timers available inside the test.
Right now I have inside the test
But setInterval isn't super accurate, so it becomes more difficult to e.g. have a dedup test, since I cannot really rely on iterations or actual time spent. This also extends, for me at least, when what version of the cache should've been returned.