mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
add window.reportError
This commit is contained in:
@@ -149,3 +149,19 @@
|
||||
|
||||
testing.eventually(() => testing.expectEqual(true, isWindowTarget));
|
||||
</script>
|
||||
|
||||
<script id=reportError>
|
||||
let errorEventFired = false;
|
||||
let capturedError = null;
|
||||
|
||||
window.addEventListener('error', (e) => {
|
||||
errorEventFired = true;
|
||||
capturedError = e.error;
|
||||
});
|
||||
|
||||
const testError = new Error('Test error message');
|
||||
window.reportError(testError);
|
||||
|
||||
testing.expectEqual(true, errorEventFired);
|
||||
testing.expectEqual(testError, capturedError);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user