You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/__tests__/browserSuites/ready-promise.spec.js
+7-10Lines changed: 7 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -418,11 +418,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
418
418
// We also use the manager to get some of the promises
419
419
constmanager=splitio.manager();
420
420
421
-
// promise1 is handled immediately. Thus, the 'reject' callback is expected to be called in 0.15 seconds aprox.
421
+
// `ready` is called immediately. Thus, the 'reject' callback is expected to be called in 0.15 seconds aprox.
422
422
setTimeout(()=>{
423
-
constpromise1=client.ready();
424
423
consttStart=Date.now();
425
-
promise1
424
+
client.ready()
426
425
.then(()=>{
427
426
t.fail('### SDK IS READY - not TIMED OUT when it should.');
428
427
})
@@ -434,11 +433,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
434
433
});
435
434
},0);
436
435
437
-
// promise2 is handled in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
436
+
// `ready` is called in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
438
437
setTimeout(()=>{
439
-
constpromise2=manager.ready();
440
438
consttStart=Date.now();
441
-
promise2
439
+
manager.ready()
442
440
.then(()=>{
443
441
t.fail('### SDK IS READY - not TIMED OUT when it should.');
444
442
})
@@ -450,11 +448,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
450
448
});
451
449
},fromSecondsToMillis(0.15));
452
450
453
-
// promise3 is handled in 0.2 seconds, when the promise is just resolved. Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
451
+
// `ready` is called in 0.25 seconds, right after the promise is resolved (0.2 secs). Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
454
452
setTimeout(()=>{
455
-
constpromise3=manager.ready();
456
453
consttStart=Date.now();
457
-
promise3
454
+
manager.ready()
458
455
.then(()=>{
459
456
t.pass('### SDK IS READY - retry attempt finishes before the requestTimeoutBeforeReady limit');
460
457
assertGetTreatmentWhenReady(t,client);
@@ -480,7 +477,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
480
477
});
481
478
});
482
479
});
483
-
},fromSecondsToMillis(0.2));
480
+
},fromSecondsToMillis(0.25));
484
481
},'Evaluate that multiple promises are resolved/rejected on expected times.');
485
482
486
483
// Validate that warning messages are properly sent.
// promise2 is handled in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
407
+
// `ready` is called in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
409
408
setTimeout(()=>{
410
-
constpromise2=manager.ready();
411
409
consttStart=Date.now();
412
-
promise2
410
+
manager.ready()
413
411
.then(()=>{
414
412
t.fail('### SDK IS READY - not TIMED OUT when it should.');
// promise3 is handled in 0.2 seconds, when the promise is just resolved. Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
422
+
// `ready` is called in 0.25 seconds, right after the promise is resolved (0.2 secs). Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
425
423
setTimeout(()=>{
426
-
constpromise3=manager.ready();
427
424
consttStart=Date.now();
428
-
promise3
425
+
manager.ready()
429
426
.then(()=>{
430
427
t.pass('### SDK IS READY - retry attempt finishes before the requestTimeoutBeforeReady limit');
0 commit comments