@@ -29,8 +29,14 @@ use(sinonChai);
29
29
30
30
/* eslint-disable no-restricted-properties */
31
31
describe ( 'Firebase Performance > transport_service' , ( ) => {
32
- let sendBeaconStub : SinonStub < [ url : string | URL , data ?: BodyInit | null | undefined ] , boolean > ;
33
- let fetchStub : SinonStub < [ RequestInfo | URL , RequestInit ?] , Promise < Response > > ;
32
+ let sendBeaconStub : SinonStub <
33
+ [ url : string | URL , data ?: BodyInit | null | undefined ] ,
34
+ boolean
35
+ > ;
36
+ let fetchStub : SinonStub <
37
+ [ RequestInfo | URL , RequestInit ?] ,
38
+ Promise < Response >
39
+ > ;
34
40
const INITIAL_SEND_TIME_DELAY_MS = 5.5 * 1000 ;
35
41
const DEFAULT_SEND_INTERVAL_MS = 10 * 1000 ;
36
42
const MAX_EVENT_COUNT_PER_REQUEST = 1000 ;
@@ -130,10 +136,12 @@ describe('Firebase Performance > transport_service', () => {
130
136
131
137
it ( 'falls back to fetch if sendBeacon fails.' , async ( ) => {
132
138
sendBeaconStub . returns ( false ) ;
133
- fetchStub . resolves ( new Response ( '{}' , {
134
- status : 200 ,
135
- headers : { 'Content-type' : 'application/json' }
136
- } ) ) ;
139
+ fetchStub . resolves (
140
+ new Response ( '{}' , {
141
+ status : 200 ,
142
+ headers : { 'Content-type' : 'application/json' }
143
+ } )
144
+ ) ;
137
145
testTransportHandler ( 'event1' ) ;
138
146
clock . tick ( INITIAL_SEND_TIME_DELAY_MS ) ;
139
147
expect ( fetchStub ) . to . have . been . calledOnce ;
0 commit comments