Skip to content
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

Add setImmediate() and clearImmediate() to the list of non-enumerable globals #1435

Closed
dchambers opened this issue Nov 17, 2014 · 2 comments
Closed

Comments

@dchambers
Copy link

With the latest version of Sinon.JS (1.12.1) I see the following error when clock = sinon.useFakeTimers() is used within Mocha:

Error: global leaks detected: setImmediate, clearImmediate

even though I'm invoking clock.restore() within my afterEach() method. I raised this very same bug with Sinon.JS, but they said it was a Mocha issue, since:

They are restored, but the process of faking/restoring them copies them from window's prototype to window. This has been a known issue in the past: #143

Either apply the solution in #143 (comment) or ask the mocha team to add setImmediate and clearImmediate to the list of properties it should not detect as leaked globals.

They specifically pointed to this section of code within Mocha. Since this stuff should just work out of the box, I thought it was best to raise it here.

@boneskull
Copy link
Member

after educating myself on setImmediate, seems OK

@dchambers
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants