tack-up-now/e2e/urlMatcher.ts

7 lines
222 B
TypeScript

import { Page, Request } from "@playwright/test"
export default function matchPath(page: Page, path: string) {
return (url: URL | Request) =>
new URL(page.url()).hostname === url.hostname && url.pathname === path
}