File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments