-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: 🔧 set autoDetectErrors default value to false * test: ✅ update e2e test to set autoDetectErrors to true * docs: 📝 update CHANGELOG.md * test: ✅ rename unhandled promise rejection test and enable autoDetectErrors * test: ✅ test autoDetectErrors when default and overridden to true * docs: 📝 update CHANGELOG.md
- Loading branch information
1 parent
b49b594
commit deb8f69
Showing
9 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/browser/features/fixtures/web_worker/worker_auto_detect_errors/default/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<script type="text/javascript"> | ||
var NOTIFY = decodeURIComponent(window.location.search.match(/NOTIFY=([^&]+)/)[1]) | ||
var SESSIONS = decodeURIComponent(window.location.search.match(/SESSIONS=([^&]+)/)[1]) | ||
var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1]) | ||
</script> | ||
</head> | ||
<body> | ||
<script> | ||
var worker = new Worker('worker.js') | ||
worker.postMessage({ type: 'bugsnag-start', payload: { NOTIFY, SESSIONS, API_KEY } }) | ||
worker.onmessage = function () { worker.postMessage({ type: 'bugsnag-throw' }) } | ||
</script> | ||
</body> | ||
</html> |
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
test/browser/features/fixtures/web_worker/worker_auto_detect_errors/enabled/worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
importScripts("/node_modules/@bugsnag/web-worker/dist/bugsnag.web-worker.min.js") | ||
|
||
onmessage = function (e) { | ||
var payload = e.data.payload; | ||
|
||
switch (e.data.type) { | ||
case 'bugsnag-start': | ||
Bugsnag.start({ | ||
apiKey: payload.API_KEY, | ||
autoDetectErrors: true, | ||
endpoints: { | ||
notify: payload.NOTIFY, | ||
sessions: payload.SESSIONS | ||
} | ||
}) | ||
postMessage('bugsnag-ready') | ||
break; | ||
case 'bugsnag-throw': | ||
throw new Error('I am an error') | ||
default: | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters