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

tests(web-inspector): add test for setImmediate polyfill #3670

Merged
merged 2 commits into from
Oct 27, 2017

Conversation

patrickhulce
Copy link
Collaborator

reminded by gitter to add test for this :)

@@ -21,6 +21,21 @@ describe('Web Inspector lib', function() {
assert.ok(WebInspector.Color);
});

it('does not destroy setImmediate', done => {
Copy link
Member

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?

Copy link
Collaborator Author

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?

Copy link
Member

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 :)

Copy link
Member

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.

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM

@patrickhulce patrickhulce merged commit 76e51f3 into master Oct 27, 2017
@patrickhulce patrickhulce deleted the add_set_immediate_test branch October 27, 2017 23:45
christhompson pushed a commit to christhompson/lighthouse that referenced this pull request Nov 28, 2017
…e#3670)

* tests(web-inspector): add test for setImmediate polyfill

* change name, add comment
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

Successfully merging this pull request may close these issues.

2 participants