From d6722a75ec671f6beb9f731a5f62c659c0172cd6 Mon Sep 17 00:00:00 2001 From: ziyad-elabid-nw Date: Wed, 19 Jul 2023 17:15:00 +0100 Subject: [PATCH] Update unit test --- packages/react/test/errorboundary.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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', () => {