Files
supabase/e2e/shared/hosts.ts
Miranda Limonczenko 187120a718 test(e2e): share the a11y warn-mode helpers across suites
Docs owned the only warn-mode implementation, so WWW and Studio would each have
copied it. Move the reusable half into e2e/shared: the scan-result envelope, the
annotate and blocking helpers, an exclude-capable scan for covering everything
outside a region, and the viewport helpers responsive chrome needs.

Also gate the Vercel bypass secret on a Supabase host, and stop resolving a
preview URL from a skipped Vercel build.

Docs behavior is unchanged: the emitted axe-results.json is byte-identical.
2026-08-17 11:21:44 -07:00

14 lines
358 B
TypeScript

// Never send a Vercel bypass secret anywhere that can't be a Supabase deployment.
export function isSupabaseHost(url: string): boolean {
try {
const { hostname } = new URL(url)
return (
hostname === 'supabase.com' ||
hostname.endsWith('.supabase.com') ||
hostname.endsWith('.vercel.app')
)
} catch {
return false
}
}