@@ -75,7 +75,7 @@ describe('httpPollingDatafileManager', () => {
75
75
headers : { }
76
76
} )
77
77
manager . start ( )
78
- await manager . onReady
78
+ await manager . onReady ( )
79
79
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
80
80
} )
81
81
} )
@@ -102,7 +102,7 @@ describe('httpPollingDatafileManager', () => {
102
102
manager . start ( )
103
103
expect ( makeGetRequestSpy ) . toBeCalledTimes ( 1 )
104
104
expect ( makeGetRequestSpy . mock . calls [ 0 ] [ 0 ] ) . toBe ( 'https://cdn.optimizely.com/datafiles/123.json' )
105
- await manager . onReady
105
+ await manager . onReady ( )
106
106
} )
107
107
108
108
it ( 'after being started, fetches the datafile and resolves onReady' , async ( ) => {
@@ -112,7 +112,7 @@ describe('httpPollingDatafileManager', () => {
112
112
headers : { } ,
113
113
} )
114
114
manager . start ( )
115
- await manager . onReady
115
+ await manager . onReady ( )
116
116
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
117
117
} )
118
118
@@ -127,7 +127,7 @@ describe('httpPollingDatafileManager', () => {
127
127
const setTimeoutSpy : jest . SpyInstance < ( ) => void , [ ( ) => void , number ] > = jest . spyOn ( testTimeoutFactory , 'setTimeout' )
128
128
129
129
manager . start ( )
130
- await manager . onReady
130
+ await manager . onReady ( )
131
131
expect ( setTimeoutSpy ) . toBeCalledTimes ( 1 )
132
132
expect ( setTimeoutSpy . mock . calls [ 0 ] [ 1 ] ) . toBe ( 10 )
133
133
} )
@@ -155,7 +155,7 @@ describe('httpPollingDatafileManager', () => {
155
155
manager . on ( 'update' , updateFn )
156
156
157
157
manager . start ( )
158
- await manager . onReady
158
+ await manager . onReady ( )
159
159
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
160
160
expect ( updateFn ) . toBeCalledTimes ( 0 )
161
161
@@ -184,7 +184,7 @@ describe('httpPollingDatafileManager', () => {
184
184
)
185
185
186
186
manager . start ( )
187
- await manager . onReady
187
+ await manager . onReady ( )
188
188
189
189
expect ( testTimeoutFactory . timeoutFns . length ) . toBe ( 1 )
190
190
expect ( testTimeoutFactory . cancelFns . length ) . toBe ( 1 )
@@ -207,7 +207,7 @@ describe('httpPollingDatafileManager', () => {
207
207
)
208
208
209
209
manager . start ( )
210
- await manager . onReady
210
+ await manager . onReady ( )
211
211
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
212
212
testTimeoutFactory . timeoutFns [ 0 ] ( )
213
213
expect ( manager . responsePromises . length ) . toBe ( 2 )
@@ -255,7 +255,7 @@ describe('httpPollingDatafileManager', () => {
255
255
expect ( testTimeoutFactory . timeoutFns . length ) . toBe ( 1 )
256
256
// Trigger the update, should fetch the next response which should succeed, then we get ready
257
257
testTimeoutFactory . timeoutFns [ 0 ] ( )
258
- await manager . onReady
258
+ await manager . onReady ( )
259
259
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
260
260
} )
261
261
@@ -280,7 +280,7 @@ describe('httpPollingDatafileManager', () => {
280
280
manager . on ( 'update' , updateFn )
281
281
282
282
manager . start ( )
283
- await manager . onReady
283
+ await manager . onReady ( )
284
284
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
285
285
// First response promise was for the initial 200 response
286
286
expect ( manager . responsePromises . length ) . toBe ( 1 )
@@ -310,7 +310,7 @@ describe('httpPollingDatafileManager', () => {
310
310
}
311
311
)
312
312
manager . start ( )
313
- await manager . onReady
313
+ await manager . onReady ( )
314
314
const makeGetRequestSpy = jest . spyOn ( manager , 'makeGetRequest' )
315
315
testTimeoutFactory . timeoutFns [ 0 ] ( )
316
316
expect ( makeGetRequestSpy ) . toBeCalledTimes ( 1 )
@@ -337,7 +337,7 @@ describe('httpPollingDatafileManager', () => {
337
337
headers : { } ,
338
338
} )
339
339
manager . start ( )
340
- await manager . onReady
340
+ await manager . onReady ( )
341
341
expect ( manager . get ( ) ) . toBe ( '{"foo": "bar"}' )
342
342
} )
343
343
@@ -350,7 +350,7 @@ describe('httpPollingDatafileManager', () => {
350
350
const updateFn = jest . fn ( )
351
351
manager . on ( 'update' , updateFn )
352
352
manager . start ( )
353
- await manager . onReady
353
+ await manager . onReady ( )
354
354
expect ( testTimeoutFactory . timeoutFns . length ) . toBe ( 0 )
355
355
} )
356
356
@@ -365,7 +365,7 @@ describe('httpPollingDatafileManager', () => {
365
365
manager . start ( )
366
366
let didReject = false
367
367
try {
368
- await manager . onReady
368
+ await manager . onReady ( )
369
369
} catch ( e ) {
370
370
didReject = true
371
371
}
@@ -392,7 +392,7 @@ describe('httpPollingDatafileManager', () => {
392
392
manager . start ( )
393
393
expect ( makeGetRequestSpy ) . toBeCalledTimes ( 1 )
394
394
expect ( makeGetRequestSpy . mock . calls [ 0 ] [ 0 ] ) . toBe ( 'https://localhost:5556/datafiles/456' )
395
- await manager . onReady
395
+ await manager . onReady ( )
396
396
} )
397
397
} )
398
398
} )
0 commit comments