test(e2e): Test building a create-react-app app with Sentry SDK#5848
Merged
Conversation
added 18 commits
September 27, 2022 15:40
AbhiPrasad
reviewed
Sep 28, 2022
| @@ -0,0 +1,20 @@ | |||
| { | |||
| "compilerOptions": { | |||
| "target": "es5", | |||
Contributor
There was a problem hiding this comment.
lol it's es5 by default??
85776f6 to
0eef5a5
Compare
added 2 commits
September 28, 2022 20:59
AbhiPrasad
approved these changes
Sep 29, 2022
|
|
||
| function App() { | ||
| return ( | ||
| <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}> |
Contributor
There was a problem hiding this comment.
Let's make us of the more fleshed out fallback.
Suggested change
| <Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}> | |
| <Sentry.ErrorBoundary | |
| fallback={({ error, componentStack, resetError }) => ( | |
| <React.Fragment> | |
| <div>You have encountered an error</div> | |
| <div>{error.toString()}</div> | |
| <div>{componentStack}</div> | |
| <button | |
| onClick={() => { | |
| this.setState({ message: "This is my app" }); | |
| {/* When resetError() is called it will remove the Fallback component */} | |
| {/* and render the Sentry ErrorBoundary's children in their initial state */} | |
| resetError(); | |
| }} | |
| > | |
| Click here to reset! | |
| </button> | |
| </React.Fragment> | |
| )} | |
| > |
Contributor
size-limit report 📦
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: #5506
Create first E2E test that tests adding Sentry to a
create-react-appapplication.It tests the following things:
@sentry/reactand@sentry/tracinginit,BrowserTracingintegration,ErrorBoundary,withProfileyarn buildrunstsc/typechecking under the hood)