diff --git a/browser.d.ts b/browser.d.ts index 9bbd47a..2a4c3d0 100644 --- a/browser.d.ts +++ b/browser.d.ts @@ -16,7 +16,7 @@ declare function sentryTestkit< declare namespace sentryTestkit { interface Page { on(event: string, handler: (...args: any[]) => any): void - removeListener(event: string, handler: (...args: any[]) => any): void + off(event: string, handler: (...args: any[]) => any): void } interface ReportError { diff --git a/src/testkit.ts b/src/testkit.ts index 1740634..5832468 100644 --- a/src/testkit.ts +++ b/src/testkit.ts @@ -36,7 +36,7 @@ export function createTestkit(): Testkit { }, stopListening: (page: any) => { - page.removeListener('request', puppeteerHandler) + page.off('request', puppeteerHandler) }, }, diff --git a/src/types.ts b/src/types.ts index f05d06d..dd06ba3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,7 +16,7 @@ declare function sentryTestkit< declare namespace sentryTestkit { interface Page { on(event: string, handler: (...args: any[]) => any): void - removeListener(event: string, handler: (...args: any[]) => any): void + off(event: string, handler: (...args: any[]) => any): void } interface ReportError {