Skip to content

Conversation

leon19
Copy link
Contributor

@leon19 leon19 commented Jun 29, 2025

Make it work with sinon and jest fake timers. Fixes #2200

Importing timers instead of using the global ones would still not work for jest

Copy link
Contributor

@mikicho mikicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic PR! Thank you!

@mikicho
Copy link
Contributor

mikicho commented Jun 29, 2025

@leon19 I'm wondering if it breaks current workarounds as described in the fixed issue.

@leon19
Copy link
Contributor Author

leon19 commented Jun 29, 2025

@leon19 I'm wondering if it breaks current workarounds as described in the fixed issue.

I've added tests for covering the "advance timers" workaround when the timers are mocked, but there is no delay involved

@mikicho
Copy link
Contributor

mikicho commented Jul 25, 2025

@leon19 is it ready for merge?

@leon19
Copy link
Contributor Author

leon19 commented Jul 26, 2025

@leon19 is it ready for merge?

Yes, it's ready 👌

@mikicho mikicho merged commit fb112f3 into nock:main Jul 26, 2025
13 of 14 checks passed
Copy link

🎉 This PR is included in version 14.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@leon19 leon19 deleted the fix/mocked-timers branch July 26, 2025 16:07
leon19 added a commit to leon19/nock that referenced this pull request Aug 7, 2025
mikicho pushed a commit that referenced this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeout when using jest "useFakeTimers" functionality
2 participants