@@ -299,6 +299,9 @@ function mockTopicSubscriptionRequestWithError(
299299 } ) ;
300300}
301301
302+ function disableRetries ( messaging : Messaging ) {
303+ ( messaging as any ) . messagingRequestHandler . httpClient . retry = null ;
304+ }
302305
303306describe ( 'Messaging' , ( ) => {
304307 let mockApp : FirebaseApp ;
@@ -1167,6 +1170,7 @@ describe('Messaging', () => {
11671170 _ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
11681171 it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
11691172 mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1173+ disableRetries ( messaging ) ;
11701174
11711175 return messaging . sendToDevice (
11721176 mocks . messaging . registrationToken ,
@@ -1460,6 +1464,7 @@ describe('Messaging', () => {
14601464 _ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
14611465 it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
14621466 mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1467+ disableRetries ( messaging ) ;
14631468
14641469 return messaging . sendToDeviceGroup (
14651470 mocks . messaging . notificationKey ,
@@ -1710,6 +1715,7 @@ describe('Messaging', () => {
17101715 _ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
17111716 it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
17121717 mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1718+ disableRetries ( messaging ) ;
17131719
17141720 return messaging . sendToTopic (
17151721 mocks . messaging . topic ,
@@ -1928,6 +1934,7 @@ describe('Messaging', () => {
19281934 _ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
19291935 it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
19301936 mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1937+ disableRetries ( messaging ) ;
19311938
19321939 return messaging . sendToCondition (
19331940 mocks . messaging . condition ,
@@ -3398,6 +3405,7 @@ describe('Messaging', () => {
33983405 _ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
33993406 it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
34003407 mockedRequests . push ( mockTopicSubscriptionRequestWithError ( methodName , parseInt ( statusCode , 10 ) , 'text' ) ) ;
3408+ disableRetries ( messaging ) ;
34013409
34023410 return messagingService [ methodName ] (
34033411 mocks . messaging . registrationToken ,
0 commit comments