Skip to content

Commit d6722a7

Browse files
Update unit test
1 parent 2c37943 commit d6722a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/react/test/errorboundary.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ describe('ErrorBoundary', () => {
386386
const mockOnError = jest.fn();
387387

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

416416
const error = mockCaptureException.mock.calls[0][0];
417-
const cause = error.cause;
418417
// We need to make sure that the length of the cause message is 250
419-
expect(cause.message).toHaveLength(250);
418+
expect(error.cause.message).toHaveLength(250);
420419
});
421420

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

0 commit comments

Comments
 (0)