-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(browser): log ErrorEvent.message when unhandled ErrorEvent.error is null
#9322
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { test } from "vitest"; | ||
|
|
||
| test("ResizeObserver error", async () => { | ||
| const divElem = document.createElement("div"); | ||
| divElem.style.width = "100px"; | ||
| divElem.style.height = "100px"; | ||
| document.body.appendChild(divElem); | ||
|
|
||
| const resizeObserver = new ResizeObserver((entries) => { | ||
| for (const entry of entries) { | ||
| (entry.target as HTMLElement).style.width = | ||
| `${entry.contentBoxSize[0].inlineSize + 10}px`; | ||
| } | ||
| }); | ||
| const promise = Promise.withResolvers(); | ||
| window.addEventListener("error", (event) => { | ||
| if (event.message.includes("ResizeObserver loop")) { | ||
| promise.resolve(null); | ||
| } | ||
| }); | ||
| resizeObserver.observe(divElem); | ||
| await promise.promise; | ||
| resizeObserver.unobserve(divElem); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { fileURLToPath } from 'node:url' | ||
| import { defineConfig } from 'vitest/config' | ||
| import { instances, provider } from '../../settings' | ||
|
|
||
| export default defineConfig({ | ||
| cacheDir: fileURLToPath(new URL("./node_modules/.vite", import.meta.url)), | ||
| test: { | ||
| browser: { | ||
| enabled: true, | ||
| provider, | ||
| instances, | ||
| headless: true, | ||
| }, | ||
| }, | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,9 @@ const devInstances: BrowserInstanceOption[] = [ | |
| const playwrightInstances: BrowserInstanceOption[] = [ | ||
| { browser: 'chromium' }, | ||
| { browser: 'firefox' }, | ||
| { browser: 'webkit' }, | ||
| // hard to setup playwright webkit on some machines (e.g. ArchLinux) | ||
| // this allows skipping it locally by BROWSER_NO_WEBKIT=true | ||
| ...(process.env.BROWSER_NO_WEBKIT ? [] : [{ browser: 'webkit' as const }]), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this being set anywhere?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for me to run test locally by |
||
| ] | ||
|
|
||
| const webdriverioInstances: BrowserInstanceOption[] = [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.