mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: update types and test (#12564)
This commit is contained in:
parent
8b2059f82a
commit
33b3cefb83
@ -9,8 +9,7 @@ import type Debug from 'debug';
|
||||
import {isNode} from '../environment.js';
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var __PUPPETEER_DEBUG: string;
|
||||
const __PUPPETEER_DEBUG: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -190,11 +190,9 @@ export function bubble<T extends EventType[]>(events?: T) {
|
||||
emitter.on('*', handler);
|
||||
set.call(this, emitter);
|
||||
},
|
||||
// @ts-expect-error -- TypeScript incorrectly types init to require a
|
||||
// return.
|
||||
init(emitter) {
|
||||
if (emitter === undefined) {
|
||||
return;
|
||||
return emitter;
|
||||
}
|
||||
const handler = bubbleHandlers.get(this)!.get(events)!;
|
||||
|
||||
|
@ -207,14 +207,10 @@ describe('OOPIF', function () {
|
||||
);
|
||||
const frame = await framePromise;
|
||||
await frame.evaluate(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
_test = 'Test 123!';
|
||||
(window as any)._test = 'Test 123!';
|
||||
});
|
||||
const result = await frame.evaluate(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
return window._test;
|
||||
return (window as any)._test;
|
||||
});
|
||||
expect(result).toBe('Test 123!');
|
||||
});
|
||||
|
@ -134,8 +134,11 @@ describe('request interception', function () {
|
||||
await cdp.send('DOM.enable');
|
||||
const urls: string[] = [];
|
||||
page.on('request', request => {
|
||||
void request.continue();
|
||||
if (isFavicon(request)) {
|
||||
return;
|
||||
}
|
||||
urls.push(request.url());
|
||||
return request.continue();
|
||||
});
|
||||
// This causes network requests without networkId.
|
||||
await cdp.send('CSS.enable');
|
||||
|
Loading…
Reference in New Issue
Block a user