Skip to content

Commit e4bef71

Browse files
author
Aidan Zimmermann
committed
STREAM-1362: fix line coverage
1 parent 042a567 commit e4bef71

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/unit/notifications.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,5 +1216,22 @@ describe('Notifications', () => {
12161216
await expect(notification.bulkSubscribe(['topicA'], { replace: true }))
12171217
.rejects.toThrow('Network failure');
12181218
});
1219+
1220+
it('should rethrow when error has no message property', async () => {
1221+
const errorWithoutMessage = { code: 'ECONNRESET' };
1222+
jest.spyOn(notification, 'makeBulkSubscribeRequest')
1223+
.mockRejectedValueOnce(errorWithoutMessage);
1224+
1225+
await expect(notification.bulkSubscribe(['topicA'], { replace: true }))
1226+
.rejects.toEqual(errorWithoutMessage);
1227+
});
1228+
1229+
it('should rethrow when error is null', async () => {
1230+
jest.spyOn(notification, 'makeBulkSubscribeRequest')
1231+
.mockRejectedValueOnce(null);
1232+
1233+
await expect(notification.bulkSubscribe(['topicA'], { replace: true }))
1234+
.rejects.toBeNull();
1235+
});
12191236
});
12201237
});

0 commit comments

Comments
 (0)