@@ -115,9 +115,12 @@ export default function (fetchMock, assert) {
115115 } ;
116116 localStorage . clear ( ) ;
117117
118- // simulate a localStorage failure when saving a FF
118+ // simulate a localStorage failure when saving a FF and a membership
119119 const originalSetItem = localStorage . setItem ;
120120 localStorage . setItem = ( key , value ) => {
121+ if ( key . includes ( '.nicolas@split.io.' ) ) {
122+ throw new Error ( 'localStorage.setItem failed' ) ;
123+ }
121124 if ( key . includes ( '.split.' ) ) {
122125 localStorage . setItem = originalSetItem ;
123126 throw new Error ( 'localStorage.setItem failed' ) ;
@@ -128,8 +131,9 @@ export default function (fetchMock, assert) {
128131 t . plan ( 4 ) ;
129132
130133 fetchMock . getOnce ( testUrls . sdk + '/splitChanges?s=1.3&since=-1&rbSince=-1' , { status : 200 , body : splitChangesMock1 } ) ;
131- fetchMock . getOnce ( testUrls . sdk + '/splitChanges?s=1.3&since=-1&rbSince=-1' , { status : 200 , body : splitChangesMock1 } ) ;
134+ fetchMock . getOnce ( testUrls . sdk + '/splitChanges?s=1.3&since=-1&rbSince=-1' , { status : 200 , body : splitChangesMock1 } ) ; // retry
132135 fetchMock . getOnce ( testUrls . sdk + '/memberships/nicolas%40split.io' , { status : 200 , body : membershipsNicolas } ) ;
136+ fetchMock . getOnce ( testUrls . sdk + '/memberships/nicolas%40split.io' , { status : 200 , body : membershipsNicolas } ) ; // retry
133137 fetchMock . getOnce ( testUrls . sdk + '/memberships/nicolas2%40split.io' , { status : 200 , body : { 'ms' : { } } } ) ;
134138 fetchMock . getOnce ( testUrls . sdk + '/memberships/nicolas3%40split.io' , { status : 200 , body : { 'ms' : { } } } ) ;
135139
@@ -143,7 +147,8 @@ export default function (fetchMock, assert) {
143147 type : 'LOCALSTORAGE' ,
144148 prefix : 'readyFromCache_1'
145149 } ,
146- urls : testUrls
150+ urls : testUrls ,
151+ debug : 'WARN'
147152 } ) ;
148153 const client = splitio . client ( ) ;
149154 const client2 = splitio . client ( 'nicolas2@split.io' ) ;
0 commit comments