Skip to content

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

Merged
patrickhulce merged 2 commits intomasterfrom
add_set_immediate_test
Oct 27, 2017
Merged

tests(web-inspector): add test for setImmediate polyfill#3670
patrickhulce merged 2 commits intomasterfrom
add_set_immediate_test

Conversation

@patrickhulce
Copy link
Collaborator

reminded by gitter to add test for this :)

@patrickhulce patrickhulce force-pushed the add_set_immediate_test branch from ac6a84d to 7c0980b Compare October 27, 2017 16:47
assert.ok(WebInspector.Color);
});

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

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
Contributor

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
Contributor

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
Contributor

@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