-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
tests(web-inspector): add test for setImmediate polyfill #3670
Conversation
ac6a84d
to
7c0980b
Compare
@@ -21,6 +21,21 @@ describe('Web Inspector lib', function() { | |||
assert.ok(WebInspector.Color); | |||
}); | |||
|
|||
it('does not destroy setImmediate', done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not immediately clear what's being tested here. Is this checking for the specific WebInspector (bad) setImmediate
implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
does not break setImmediate
does not polyfill setImmediate incorrectly
any better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that helps, though maybe a comment about why arg.foo();
would throw, too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also TIL setImmediate
also exists on require('timers').setImmediate
, so could check setImmediate === require('timers').setImmediate
in addition to this functional test.
In theory someone could overwrite that as well, but they may deserve to screw things up by the time they reach that level of effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…e#3670) * tests(web-inspector): add test for setImmediate polyfill * change name, add comment
reminded by gitter to add test for this :)