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

feat: add missing slowMo to launchPersistentContext #1597

Merged
merged 3 commits into from
Mar 31, 2020

Conversation

JoelEinbinder
Copy link
Contributor

slowMo was missing in launchPersistentContext, and I refactored the types a bit.

test/launcher.spec.js Outdated Show resolved Hide resolved
async launchPersistentContext(userDataDir: string, options: LaunchOptions = {}): Promise<BrowserContext> {
const {
timeout = 30000,
slowMo = undefined
Copy link
Member

Choose a reason for hiding this comment

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

nit: it should be ok to drop = undefined initialization and leave just slowMo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to = 0. I don't like destructing an optional value without a default. Feels like a bug to me at first glance, even though it isn't.

wsEndpoint: string
} & BrowserOptions;

type BrowserOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am personally lost in all these types. For example, I don't understand why BrowserOptions include slowMo. Can we just inline all the one-offs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I inlined BrowserOptions, and changed the types we export.

BrowserArgsOptions: For default args method
LaunchOptions: For the launch and launchPersistent methods
LaunchServerOptions: For launchServer and _launchServer methods
ConnectOptions: For connect method

Hopefully things are easier to follow now!

utils/generate_types/overrides.d.ts Outdated Show resolved Hide resolved
@JoelEinbinder JoelEinbinder merged commit 6053784 into microsoft:master Mar 31, 2020
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