MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / forceTheme

Function forceTheme

e2e/tests/utils.ts:26–31  ·  view source on GitHub ↗
(page: Page, theme: 'light' | 'dark')

Source from the content-addressed store, hash-verified

24export const BASE_URL = 'http://localhost:5555';
25export const API_BASE_URL = 'http://localhost:8080';
26
27export async function forceTheme(page: Page, theme: 'light' | 'dark') {
28 await page.addInitScript(theme => {
29 localStorage.setItem('webstatus-theme', theme);
30 }, theme);
31 await page.emulateMedia({colorScheme: theme});
32}
33
34/**

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected