@@ -1363,7 +1363,7 @@ test('Stopping repository should stop storage provider updates', async (t) => {
1363
1363
} ) ;
1364
1364
1365
1365
test ( 'Streaming' , async ( t ) => {
1366
- t . plan ( 7 ) ;
1366
+ t . plan ( 5 ) ;
1367
1367
const url = 'http://unleash-test-streaming.app' ;
1368
1368
const feature = {
1369
1369
name : 'feature' ,
@@ -1408,7 +1408,7 @@ test('Streaming', async (t) => {
1408
1408
// first connection is ignored, since we do regular fetch
1409
1409
eventSource . emit ( 'unleash-connected' , {
1410
1410
type : 'unleash-connected' ,
1411
- data : JSON . stringify ( { meta : { } , features : [ { ...feature , name : 'intialConnectedIgnored' } ] } ) ,
1411
+ data : JSON . stringify ( { features : [ { ...feature , name : 'intialConnectedIgnored' } ] } ) ,
1412
1412
} ) ;
1413
1413
1414
1414
const before = repo . getToggles ( ) ;
@@ -1417,22 +1417,17 @@ test('Streaming', async (t) => {
1417
1417
// update with feature
1418
1418
eventSource . emit ( 'unleash-updated' , {
1419
1419
type : 'unleash-updated' ,
1420
- data : JSON . stringify ( { meta : { } , features : [ { ...feature , name : 'firstUpdate' } ] } ) ,
1420
+ data : JSON . stringify ( { features : [ { ...feature , name : 'firstUpdate' } ] } ) ,
1421
1421
} ) ;
1422
1422
const firstUpdate = repo . getToggles ( ) ;
1423
1423
t . deepEqual ( firstUpdate , [ { ...feature , name : 'firstUpdate' } ] ) ;
1424
- // @ts -expect-error
1425
- t . is ( repo . etag , undefined ) ;
1426
1424
1427
- // update with etag
1428
1425
eventSource . emit ( 'unleash-updated' , {
1429
1426
type : 'unleash-updated' ,
1430
- data : JSON . stringify ( { meta : { etag : 'updated' } , features : [ ] } ) ,
1427
+ data : JSON . stringify ( { features : [ ] } ) ,
1431
1428
} ) ;
1432
1429
const secondUpdate = repo . getToggles ( ) ;
1433
1430
t . deepEqual ( secondUpdate , [ ] ) ;
1434
- // @ts -expect-error
1435
- t . is ( repo . etag , 'updated' ) ;
1436
1431
1437
1432
// SSE error translated to repo warning
1438
1433
repo . on ( 'warn' , ( msg ) => {
@@ -1443,7 +1438,7 @@ test('Streaming', async (t) => {
1443
1438
// re-connect simulation
1444
1439
eventSource . emit ( 'unleash-connected' , {
1445
1440
type : 'unleash-connected' ,
1446
- data : JSON . stringify ( { meta : { } , features : [ { ...feature , name : 'reconnectUpdate' } ] } ) ,
1441
+ data : JSON . stringify ( { features : [ { ...feature , name : 'reconnectUpdate' } ] } ) ,
1447
1442
} ) ;
1448
1443
const reconnectUpdate = repo . getToggles ( ) ;
1449
1444
t . deepEqual ( reconnectUpdate , [ { ...feature , name : 'reconnectUpdate' } ] ) ;
0 commit comments