-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add initial integration tests for @sentry/browser
public API.
#4333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report
|
9573638
to
7d84dc3
Compare
Maybe we forgo the For sentry-javascript/packages/browser/src/helpers.ts Lines 203 to 215 in 940faf8
|
This is a good start Onur! To make it easier to review, could you split this PR up into different PRs per test suite? We can make as many branches as we want :) |
@AbhiPrasad could you share some more context on this? |
If you ever need this, IMHO the best way is to write a custom transport and use that transport to synchronize the behavior of the SDK with the test code. |
There are currently no instances of us using IMO |
I think this is simply due to no error event == no perceived problem. We have no visibility onto events that are not flushed out, but for browser that's on the end user interacting with the browser to decide, so...
👍 ... considering the lifetime of a page and the JS execution context, I agree that for the majority of cases flushing for browser apps can be handled exclusively by the SDK. And to be clear, I also agree that we don't need to focus on I do see a case where |
Closing as this PR is replaced by separate PRs per API. |
[Incomplete]
Resolves: #4261
cc: @AbhiPrasad, @rhcarvalho
The tests are not too deep, as per our discussion before, please point out the places that are ended up too shallow, so I'll extend them.
Tests for
Sentry.flush
andSentry.showReportDialog
are missing.Two questions:
Any suggestions on how to create a state that we guarantee that event queue stays unflushed until we call
Sentry.flush()
?What scenario would be good to test
Sentry.showReportDialog
? (Script injection / Existence of theiframe
/ Interactivity?)