Download packages/app/e2e/utils/errors.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/utils/errors.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/e2e/utils/errors.ts
-
curl -L -o errors.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/e2e/utils/errors.ts
582 Bytes
| import { expect, type Page } from "@playwright/test" | |
| export function trackPageErrors(page: Page) { | |
| const errors: string[] = [] | |
| page.on("console", (message) => { | |
| if (message.type() === "error") errors.push(message.text()) | |
| }) | |
| page.on("pageerror", (error) => errors.push(error.stack ?? error.message)) | |
| return errors | |
| } | |
| export function expectNoSmokeErrors(consoleErrors: string[], toastErrors: string[], forbiddenText: string[]) { | |
| expect({ consoleErrors, toastErrors, forbiddenText }).toEqual({ | |
| consoleErrors: [], | |
| toastErrors: [], | |
| forbiddenText: [], | |
| }) | |
| } | |