From 3a1b36eb789ad423074da557e3cb9e6de3076b1d 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react/test/errorboundary.test.tsx b/packages/react/test/errorboundary.test.tsx index ef97e07723f2..d008bcd56456 100644 --- a/packages/react/test/errorboundary.test.tsx +++ b/packages/react/test/errorboundary.test.tsx @@ -386,11 +386,11 @@ 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 - error.cause = cause; + firsterror.cause = cause; throw 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', () => {