@@ -255,31 +255,30 @@ export const flagStepDefinitions: StepDefinitions = ({ given, and, when, then })
255255 } ,
256256 ) ;
257257
258- let ran : Promise < boolean > ;
258+ let ran : boolean ;
259259 when ( 'a PROVIDER_READY handler is added' , ( ) => {
260- ran = new Promise < boolean > ( ( resolve ) => {
261- client . addHandler ( ProviderEvents . Ready , async ( ) => {
262- resolve ( true ) ;
263- } ) ;
260+ client . addHandler ( ProviderEvents . Ready , async ( ) => {
261+ ran = true ;
264262 } ) ;
265263 } ) ;
266264 then ( 'the PROVIDER_READY handler must run' , ( ) => {
267265 expect ( ran ) . toBeTruthy ( ) ;
268266 } ) ;
269267
270268 when ( 'a PROVIDER_CONFIGURATION_CHANGED handler is added' , ( ) => {
271- ran = new Promise < boolean > ( ( resolve ) => {
272- client . addHandler ( ProviderEvents . ConfigurationChanged , async ( details ) => {
273- // file writes are not atomic, so we get a few events in quick succession from the testbed
274- // some will not contain changes, this tolerates that; at least 1 should have our change
275-
276- // All Flags are changed we do not provide a list of changed flags, that is the nature of the web sdk
277- //if (details?.flagsChanged?.length) {
278- // flagsChanged = details?.flagsChanged;
279-
280- resolve ( true ) ;
281- //}
282- } ) ;
269+ client . addHandler ( ProviderEvents . ConfigurationChanged , async ( details ) => {
270+ // file writes are not atomic, so we get a few events in quick succession from the testbed
271+ // some will not contain changes, this tolerates that; at least 1 should have our change
272+
273+
274+ // TODO: enable this for testing of issue
275+ //if (details?.flagsChanged?.length) {
276+ // flagsChanged = details?.flagsChanged;
277+ // ran = true;
278+ //}
279+
280+ // TODO: remove this for testing of issue
281+ ran = true ;
283282 } ) ;
284283 } ) ;
285284
@@ -289,11 +288,11 @@ export const flagStepDefinitions: StepDefinitions = ({ given, and, when, then })
289288 } ) ;
290289
291290 then ( 'the PROVIDER_CONFIGURATION_CHANGED handler must run' , async ( ) => {
292- expect ( await ran ) . toBeTruthy ( ) ;
291+ expect ( ran ) . toBeTruthy ( ) ;
293292 } ) ;
294293
295294 and ( / ^ t h e e v e n t d e t a i l s m u s t i n d i c a t e " ( .* ) " w a s a l t e r e d $ / , ( flagName ) => {
296- // All Flags are changed we do not provide a list of changed flags, that is the nature of the web sdk
295+ // TODO: enable this for testing of issue
297296 //expect(flagsChanged).toContain(flagName);
298297 } ) ;
299298
0 commit comments