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>
This commit is contained in:
dhellgartner
2023-02-16 21:13:57 +01:00
committed by GitHub
parent 3430b33c3e
commit f22c529eab

View File

@@ -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>