mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: add a test for a service worker with ignoreHTTPSErrors
This commit is contained in:
parent
cbf757efce
commit
f20669163e
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user