@@ -299,6 +299,9 @@ function mockTopicSubscriptionRequestWithError(
299
299
} ) ;
300
300
}
301
301
302
+ function disableRetries ( messaging : Messaging ) {
303
+ ( messaging as any ) . messagingRequestHandler . httpClient . retry = null ;
304
+ }
302
305
303
306
describe ( 'Messaging' , ( ) => {
304
307
let mockApp : FirebaseApp ;
@@ -1167,6 +1170,7 @@ describe('Messaging', () => {
1167
1170
_ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
1168
1171
it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
1169
1172
mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1173
+ disableRetries ( messaging ) ;
1170
1174
1171
1175
return messaging . sendToDevice (
1172
1176
mocks . messaging . registrationToken ,
@@ -1460,6 +1464,7 @@ describe('Messaging', () => {
1460
1464
_ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
1461
1465
it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
1462
1466
mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1467
+ disableRetries ( messaging ) ;
1463
1468
1464
1469
return messaging . sendToDeviceGroup (
1465
1470
mocks . messaging . notificationKey ,
@@ -1710,6 +1715,7 @@ describe('Messaging', () => {
1710
1715
_ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
1711
1716
it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
1712
1717
mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1718
+ disableRetries ( messaging ) ;
1713
1719
1714
1720
return messaging . sendToTopic (
1715
1721
mocks . messaging . topic ,
@@ -1928,6 +1934,7 @@ describe('Messaging', () => {
1928
1934
_ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
1929
1935
it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
1930
1936
mockedRequests . push ( mockSendRequestWithError ( parseInt ( statusCode , 10 ) , 'text' ) ) ;
1937
+ disableRetries ( messaging ) ;
1931
1938
1932
1939
return messaging . sendToCondition (
1933
1940
mocks . messaging . condition ,
@@ -3398,6 +3405,7 @@ describe('Messaging', () => {
3398
3405
_ . forEach ( STATUS_CODE_TO_ERROR_MAP , ( expectedError , statusCode ) => {
3399
3406
it ( `should be rejected given a ${ statusCode } text server response` , ( ) => {
3400
3407
mockedRequests . push ( mockTopicSubscriptionRequestWithError ( methodName , parseInt ( statusCode , 10 ) , 'text' ) ) ;
3408
+ disableRetries ( messaging ) ;
3401
3409
3402
3410
return messagingService [ methodName ] (
3403
3411
mocks . messaging . registrationToken ,
0 commit comments