diff --git a/packages/react/test/errorboundary.test.tsx b/packages/react/test/errorboundary.test.tsx index ef97e07723f2..7af892fddc87 100644 --- a/packages/react/test/errorboundary.test.tsx +++ b/packages/react/test/errorboundary.test.tsx @@ -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 @@ -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', () => {