-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(browser): Add integration tests for captureMessage
#4351
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
|
captureMessage
captureMessage
|
||
expect(eventData.message).toBe('message_with_hint'); | ||
expect(eventData.level).toBe('error'); | ||
expect((eventData as Event & { hint: EventHint }).hint.captureContext).toMatchObject({ |
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.
I don't think we need to assert on the hint here, we can just unit test that.
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
beforeSend: event => { | ||
window.events.push(event); |
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.
we can remove this
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.
@AbhiPrasad, I have opened a PR for an alternative implementation for getting multiple events into tests without this hack. could you take a look? -> #4355
… into onur/public-api-tests-capture-message
2f4d184
to
11254fc
Compare
Part of: #4333