Title: Improve error throwing behaviour in browser integration test · Issue #11678 · getsentry/sentry-javascript · GitHub
Open Graph Title: Improve error throwing behaviour in browser integration test · Issue #11678 · getsentry/sentry-javascript
X Title: Improve error throwing behaviour in browser integration test · Issue #11678 · getsentry/sentry-javascript
Description: Problem Statement Currently, it's quite annoying to just throw an error in a browser integration test and to check for the resulting payload. The intuitive way would be to just top-level call throw new Error() in subject.js. However, the...
Open Graph Description: Problem Statement Currently, it's quite annoying to just throw an error in a browser integration test and to check for the resulting payload. The intuitive way would be to just top-level call throw...
X Description: Problem Statement Currently, it's quite annoying to just throw an error in a browser integration test and to check for the resulting payload. The intuitive way would be to just top-level call t...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/11678
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve error throwing behaviour in browser integration test ","articleBody":"### Problem Statement\n\nCurrently, it's quite annoying to just `throw` an error in a browser integration test and to check for the resulting payload. The intuitive way would be to just top-level call `throw new Error()` in `subject.js`. However, the resulting error gets thrown as a [\"Script Error\"](https://sentry.io/answers/script-error/) because it's thrown synchronously when the subject bundle JS is evaluated by the browser. This error is [filtered by the SDK](https://github.com/getsentry/sentry-javascript/blob/30aa211da48439eba3b922fdfa10dfc4f2524c7a/packages/core/src/integrations/inboundfilters.ts/#L9-L14) by default for good reason.\n\n### Solution Brainstorm\n\nIdeally, we can work around this in one way or another so that we can have a simple way of throwing errors in a test that actually make it through the SDK. I have a couple of ideas but we'd need to check what the best approach is. Also I'm definitely open to other ideas.\r\n\r\n1. wrap `subject.js` code in a `setTimeout` call. This will cause the initial bundle evaluation to succeed and potential errors should be thrown as intended by testers.\r\n2. let the test framework accept another file (e.g. `async-subject.js`) that does what's suggested in 1. `subject.js` would stay sync as previously.\r\n3. we could just create a test utility (e.g. `triggerError(err: unkown)`) that calls `page.evaluate`. This should work 🤔 but admittedly I didn't test it yet ","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2024-04-18T09:28:53Z","url":"https://github.com/getsentry/sentry-javascript/issues/11678"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:399035dc-cb73-ebd1-6314-f4579f8c27db |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF70:16CC07:13580C7:1A783D9:6B040F83 |
| html-safe-nonce | d71aab2021b9de8502466f7df2a8b89dc63c7a8d725e6482197626a8fa4ac53d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjcwOjE2Q0MwNzoxMzU4MEM3OjFBNzgzRDk6NkIwNDBGODMiLCJ2aXNpdG9yX2lkIjoiODI5NTIxMjI1ODYxMTY5NTQ5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f231857cff5090ff93a802f0fd7d06547c8bce30a80f409936400621d0d69ade |
| hovercard-subject-tag | issue:2250213758 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/11678/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba50d4e1c8d5fdeab5a63fd568e5edbfc5d335909bdfe320bea4f6318fc174dc/getsentry/sentry-javascript/issues/11678 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba50d4e1c8d5fdeab5a63fd568e5edbfc5d335909bdfe320bea4f6318fc174dc/getsentry/sentry-javascript/issues/11678 |
| og:image:alt | Problem Statement Currently, it's quite annoying to just throw an error in a browser integration test and to check for the resulting payload. The intuitive way would be to just top-level call throw... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width