File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
packages/runtime/test/modules Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -414,18 +414,7 @@ describe("RequestModule", () => {
414
414
test ( "the incoming request is created and moved to status DecisionRequired" , async ( ) => {
415
415
const message = await exchangeMessageWithRequest ( sRuntimeServices , rRuntimeServices , requestContent ) ;
416
416
417
- // kick every event created from requests of previous tests
418
- const receivedEvents = rRuntimeServices . eventBus . publishedEvents ;
419
- const lastEvent = receivedEvents [ receivedEvents . length - 1 ] ;
420
- const secondToLastEvent = receivedEvents [ receivedEvents . length - 2 ] ;
421
- rRuntimeServices . eventBus . reset ( ) ;
422
- rRuntimeServices . eventBus . publish ( secondToLastEvent ) ;
423
- rRuntimeServices . eventBus . publish ( lastEvent ) ;
424
-
425
- const incomingRequestReceivedEvent = await rRuntimeServices . eventBus . waitForEvent ( IncomingRequestReceivedEvent ) ;
426
- const request = incomingRequestReceivedEvent . data ;
427
- expect ( request . id ) . toBe ( message . content . id ) ;
428
-
417
+ await rRuntimeServices . eventBus . waitForEvent ( IncomingRequestReceivedEvent , ( e ) => e . data . id === message . content . id ) ;
429
418
const incomingRequestStatusChangedEvent = await rRuntimeServices . eventBus . waitForEvent (
430
419
IncomingRequestStatusChangedEvent ,
431
420
( e ) => e . data . newStatus === LocalRequestStatus . DecisionRequired
You can’t perform that action at this time.
0 commit comments