typescript is great

This commit is contained in:
Andrey Lushnikov 2020-02-12 19:22:22 -08:00
parent 7850a70e19
commit 237cbe9603
3 changed files with 3 additions and 3 deletions

View file

@ -50,7 +50,7 @@ export class Chromium implements BrowserType {
}
async launch(options?: LaunchOptions & { slowMo?: number }): Promise<CRBrowser> {
if (options && options.userDataDir)
if (options && (options as any).userDataDir)
throw new Error('userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistent` instead');
const { browserServer, transport } = await this._launchServer(options, 'local');
const browser = await CRBrowser.connect(transport!, options && options.slowMo);

View file

@ -60,7 +60,7 @@ export class Firefox implements BrowserType {
}
async launch(options?: LaunchOptions & { slowMo?: number }): Promise<FFBrowser> {
if (options && options.userDataDir)
if (options && (options as any).userDataDir)
throw new Error('userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistent` instead');
const { browserServer, transport } = await this._launchServer(options, 'local');
const browser = await FFBrowser.connect(transport!, options && options.slowMo);

View file

@ -62,7 +62,7 @@ export class WebKit implements BrowserType {
}
async launch(options?: LaunchOptions & { slowMo?: number }): Promise<WKBrowser> {
if (options && options.userDataDir)
if (options && (options as any).userDataDir)
throw new Error('userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistent` instead');
const { browserServer, transport } = await this._launchServer(options, 'local');
const browser = await WKBrowser.connect(transport!, options && options.slowMo);