Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add a test for a service worker with ignoreHTTPSErrors #12342

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/src/ignorehttpserrors.spec.ts
Expand Up @@ -125,4 +125,17 @@
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 (

Check failure on line 132 in test/src/ignorehttpserrors.spec.ts

View workflow job for this annotation

GitHub Actions / [Required] Inspect code

Returning an awaited promise is required in this context
globalThis as unknown as {
registrationPromise: Promise<{unregister: () => void}>;
}
).registrationPromise.then((registration: any) => {
return registration.unregister();
});
});
});
});