From 7c108482f443f8139ae0c19d0862c0342fb933d1 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 15 Aug 2018 13:45:34 -0700 Subject: [PATCH] Puppeteer: Fix tests (#28147) --- types/puppeteer/puppeteer-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index 96cb4fd361..e883157fec 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -27,8 +27,8 @@ import * as puppeteer from "puppeteer"; // Get the "viewport" of the page, as reported by the page. const dimensions = await page.evaluate(() => { return { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight, + width: document.documentElement!.clientWidth, + height: document.documentElement!.clientHeight, deviceScaleFactor: window.devicePixelRatio }; }); @@ -300,7 +300,7 @@ puppeteer.launch().then(async browser => { someElement; // $ExpectType ElementHandle // If one passes an ElementHandle, puppeteer will unwrap its DOM reference instead - await page.$eval('.hello-world', (e, x1: HTMLDivElement) => x1.noWrap, someElement); + await page.$eval('.hello-world', (e, x1) => (x1 as any).noWrap, someElement); browser.close(); })();