diff --git a/test/src/ignorehttpserrors.spec.ts b/test/src/ignorehttpserrors.spec.ts index d8e5603388f..ecd018ee5e7 100644 --- a/test/src/ignorehttpserrors.spec.ts +++ b/test/src/ignorehttpserrors.spec.ts @@ -125,4 +125,17 @@ describe('ignoreHTTPSErrors', function () { expect(await page.frames()[0]!.evaluate('1 + 2')).toBe(3); expect(await page.frames()[1]!.evaluate('2 + 3')).toBe(5); }); + it('works for service worker', async () => { + const {httpsServer, page} = state; + await page.goto(httpsServer.PREFIX + '/serviceworkers/empty/sw.html'); + await page.evaluate(async () => { + return ( + globalThis as unknown as { + registrationPromise: Promise<{unregister: () => void}>; + } + ).registrationPromise.then((registration: any) => { + return registration.unregister(); + }); + }); + }); });