fix: devices is a map not an array (#16729)

This commit is contained in:
Yury Semikhatsky 2022-08-22 11:34:53 -07:00 committed by GitHub
parent 35af13813c
commit b51b7e7f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -11182,7 +11182,7 @@ type AccessibilityNode = {
children?: AccessibilityNode[];
}
export const devices: Devices & DeviceDescriptor[];
export const devices: Devices;
//@ts-ignore this will be any if electron is not installed
type ElectronType = typeof import('electron');

View File

@ -232,7 +232,7 @@ type AccessibilityNode = {
children?: AccessibilityNode[];
}
export const devices: Devices & DeviceDescriptor[];
export const devices: Devices;
//@ts-ignore this will be any if electron is not installed
type ElectronType = typeof import('electron');

View File

@ -775,7 +775,7 @@ playwright.chromium.launch().then(async browser => {
const isMobileAssertion: AssertType<boolean, typeof iPhone.isMobile> = true;
}
{
const agents = playwright.devices.map(x => x.userAgent);
const agents = Object.entries(playwright.devices).map(([name, descriptor]) => descriptor.userAgent);
const assertion: AssertType<string[], typeof agents> = true;
}