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: driver test re-org phase 2 #7242

Merged
merged 2 commits into from
Feb 14, 2019
Merged

tests: driver test re-org phase 2 #7242

merged 2 commits into from
Feb 14, 2019

Conversation

patrickhulce
Copy link
Collaborator

Summary
Phase 2 of 3 of driver-test re-org. This eliminates sendCommandStubOld and moves all the tests over to fake timers.

Last step is to replace createOnceStub with a similar mock function implementation and flesh out the gotoURL tests

Related Issues/PRs
#7212

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

lgtm

assert.equal(err.code, 'PROTOCOL_TIMEOUT');
}
const pageDisablePromise = driver.sendCommand('Page.disable');
jest.advanceTimersByTime(10);
Copy link
Collaborator

Choose a reason for hiding this comment

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

fantastic

const pageDisablePromise = driver.sendCommand('Page.disable');
jest.advanceTimersByTime(10);

await expect(pageDisablePromise).rejects.toMatchObject({
Copy link
Collaborator

Choose a reason for hiding this comment

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

cool!

return driver.querySelector('invalid').then(value => {
assert.equal(value, null);
});
it('returns null when DOM.querySelector finds no node', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

great example of how moving all the mocking local makes things much easier to follow

@paulirish paulirish merged commit eb3bd41 into master Feb 14, 2019
@paulirish paulirish deleted the driver_test_reorg2 branch February 14, 2019 22:29
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.

3 participants