-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not resilient to modification of globals #516
Comments
This is absolutely true and we have done similar changes in the main Sinon project to prevent pollution to globals (like methods on the Array.prototype) affecting us. If you want to supply a fix, it should just be a handful of lines. |
Meh, the run failed: https://github.com/sinonjs/fake-timers/actions/runs/12237218608/job/34132458756
|
Arf strange! Sorry for the inconvenience, I'll have to rework it |
Please feel free to revert in case it's blocking you. I'll try to do my best to have something soon |
So weird. Works locally:
|
Ah, works in Node 20. Fails in Node 22.12.0 |
I did not notice this had failed on merge: https://github.com/sinonjs/fake-timers/commits/main/ |
Found the issue: #518 Sorry for the noise! |
The library does not resist destructive changes of the globals. As I initially reported the issue at vitest-dev/vitest#7024 I wanted to make you aware of the problem.
One fix, if you consider that it should be fixed, would be to capture the globals for Intl and Date when the code got imported.
Feel free to close, if the behavior is expected.
If the suggestion is relevant I can propose a fix.
The text was updated successfully, but these errors were encountered: