update puppeteer to use setContent with wait and housekeeping the declaration files
This commit is contained in:
23
index.d.ts
vendored
23
index.d.ts
vendored
@@ -4,26 +4,3 @@ declare namespace mitt {
|
||||
(all?: { [key: string]: Array<Handler> }): Emitter;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'delegated-events' {
|
||||
type EventHandler = (event: Event) => any;
|
||||
|
||||
type EventListenerOptions = {
|
||||
capture?: boolean;
|
||||
document?: Document;
|
||||
};
|
||||
|
||||
export function on(
|
||||
name: string,
|
||||
selector: string,
|
||||
handler: EventHandler,
|
||||
options?: EventListenerOptions,
|
||||
): void;
|
||||
export function off(
|
||||
name: string,
|
||||
selector: string,
|
||||
handler: EventHandler,
|
||||
options?: EventListenerOptions,
|
||||
): void;
|
||||
export function fire(target: EventTarget, name: string, detail?: any): void;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
"@types/mocha": "^5.2.5",
|
||||
"@types/node": "^10.11.7",
|
||||
"@types/puppeteer": "^1.9.0",
|
||||
"@types/rewire": "^2.5.28",
|
||||
"chai": "^4.2.0",
|
||||
"jest-snapshot": "^23.6.0",
|
||||
"mocha": "^5.2.0",
|
||||
|
||||
19
test.d.ts
vendored
19
test.d.ts
vendored
@@ -1,22 +1,3 @@
|
||||
declare module 'rollup-plugin-typescript' {
|
||||
function typescript(): any;
|
||||
export = typescript;
|
||||
}
|
||||
|
||||
declare module 'rollup-plugin-node-resolve' {
|
||||
function resolve(): any;
|
||||
export = resolve;
|
||||
}
|
||||
|
||||
declare module 'rollup-plugin-terser' {
|
||||
export function terser(options?: any): any;
|
||||
}
|
||||
|
||||
declare module 'rollup-plugin-postcss' {
|
||||
function postcss(options?: any): any;
|
||||
export = postcss;
|
||||
}
|
||||
|
||||
declare module 'jest-snapshot' {
|
||||
export class SnapshotState {
|
||||
constructor(testFile: string, options: any);
|
||||
|
||||
@@ -214,7 +214,12 @@ describe('record integration tests', () => {
|
||||
|
||||
it('can record node mutations', async () => {
|
||||
const page: puppeteer.Page = await this.browser.newPage();
|
||||
await page.goto(`data:text/html,${getHtml.call(this, 'select2.html')}`, {
|
||||
await page.goto('about:blank');
|
||||
// FIXME: use setContent directly when @types/puppeteer update
|
||||
const setContent = async (html: string, options: any) => {
|
||||
return page.setContent.call(page, html, options);
|
||||
};
|
||||
await setContent(getHtml.call(this, 'select2.html'), {
|
||||
waitUntil: 'networkidle0',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user