Skip to content

Commit 9f5b101

Browse files
committed
explain captureException spies
1 parent aa3c9a4 commit 9f5b101

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/test/lib/base.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,8 @@ describe('BaseClient', () => {
923923
client.captureEvent({ message: 'hello' });
924924

925925
expect(TestClient.instance!.event).toBeUndefined();
926+
// This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
927+
// error, but because `beforeSend` returned `null`
926928
expect(captureExceptionSpy).not.toBeCalled();
927929
expect(loggerWarnSpy).toBeCalledWith('`beforeSend` returned `null`, will not send event.');
928930
});
@@ -1068,6 +1070,8 @@ describe('BaseClient', () => {
10681070
client.captureEvent({ message: 'hello' }, {}, scope);
10691071

10701072
expect(TestClient.instance!.event).toBeUndefined();
1073+
// This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
1074+
// error, but because the event processor returned `null`
10711075
expect(captureExceptionSpy).not.toBeCalled();
10721076
expect(loggerLogSpy).toBeCalledWith('An event processor returned `null`, will not send event.');
10731077
});

0 commit comments

Comments
 (0)