Avoid null logs on resize observer errors (#1196)

* Resize observer sometimes throws errors which
are nothing to worry about, see also the corresponding
comment on tab-group.test.ts
* Unfortunately, the web testing library installs an
error event handler which takes precedence before the
event handlers installed in the tests
(see node_modules/@web/browser-logs/dist/logUncaughtErrors.js)
* the only possibility to avoid these null logs is to install
an error event handler at an even earlier place

Co-authored-by: Dominikus Hellgartner <dominikus.hellgartner@gmail.com>
autoload
dhellgartner 2023-02-16 21:13:57 +01:00 zatwierdzone przez GitHub
rodzic 3430b33c3e
commit f22c529eab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -30,6 +30,11 @@ export default {
<body>
<link rel="stylesheet" href="dist/themes/light.css">
<script type="module" src="dist/shoelace.js"></script>
<script>window.addEventListener('error', e => {
if(!e.error && e.message && (e.message.includes('ResizeObserver') || e.message === 'Script error.')) {
e.stopImmediatePropagation();
}
});</script>
<script type="module" src="${testFramework}"></script>
</body>
</html>