Skip to content

Commit

Permalink
Update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyad-elabid-nw committed Jul 19, 2023
1 parent 2c37943 commit d6722a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react/test/errorboundary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ describe('ErrorBoundary', () => {
const mockOnError = jest.fn();

function CustomBam(): JSX.Element {
const error = new Error('bam');
const error = new Error('Error example');
// The cause message with 610 characters
const cause = new Error('This is a very long cause message that exceeds 250 characters '.repeat(10));
// @ts-ignore Need to set cause on error
Expand Down Expand Up @@ -414,9 +414,8 @@ describe('ErrorBoundary', () => {
expect(mockOnError.mock.calls[0][0]).toEqual(mockCaptureException.mock.calls[0][0]);

const error = mockCaptureException.mock.calls[0][0];
const cause = error.cause;
// We need to make sure that the length of the cause message is 250
expect(cause.message).toHaveLength(250);
expect(error.cause.message).toHaveLength(250);
});

it('calls `beforeCapture()` when an error occurs', () => {
Expand Down

0 comments on commit d6722a7

Please sign in to comment.