@@ -255,31 +255,29 @@ export const flagStepDefinitions: StepDefinitions = ({ given, and, when, then })
255
255
} ,
256
256
) ;
257
257
258
- let ran : Promise < boolean > ;
258
+ let ran : boolean ;
259
259
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 ;
264
262
} ) ;
265
263
} ) ;
266
264
then ( 'the PROVIDER_READY handler must run' , ( ) => {
267
265
expect ( ran ) . toBeTruthy ( ) ;
268
266
} ) ;
269
267
270
268
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
+ // TODO: enable this for testing of issue
274
+ //if (details?.flagsChanged?.length) {
275
+ // flagsChanged = details?.flagsChanged;
276
+ // ran = true ;
277
+ //}
278
+
279
+ // TODO: remove this for testing of issue
280
+ ran = true ;
283
281
} ) ;
284
282
} ) ;
285
283
@@ -289,11 +287,11 @@ export const flagStepDefinitions: StepDefinitions = ({ given, and, when, then })
289
287
} ) ;
290
288
291
289
then ( 'the PROVIDER_CONFIGURATION_CHANGED handler must run' , async ( ) => {
292
- expect ( await ran ) . toBeTruthy ( ) ;
290
+ expect ( ran ) . toBeTruthy ( ) ;
293
291
} ) ;
294
292
295
293
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
294
+ // TODO: enable this for testing of issue
297
295
//expect(flagsChanged).toContain(flagName);
298
296
} ) ;
299
297
0 commit comments