-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(e2e): Test building a create-react-app app with Sentry SDK #5848
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
@@ -0,0 +1,20 @@ | |||
{ | |||
"compilerOptions": { | |||
"target": "es5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol it's es5 by default??
85776f6
to
0eef5a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
|
||
function App() { | ||
return ( | ||
<Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make us of the more fleshed out fallback.
<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> | |
)} | |
> |
size-limit report 📦
|
Ref: #5506
Create first E2E test that tests adding Sentry to a
create-react-app
application.It tests the following things:
@sentry/react
and@sentry/tracing
init
,BrowserTracing
integration,ErrorBoundary
,withProfile
yarn build
runstsc
/typechecking under the hood)