File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
packages/modules/workflow-engine-inmemory/integration-tests/__tests__ Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,21 @@ import {
2828 workflowEventGroupIdStep1Mock ,
2929 workflowEventGroupIdStep2Mock ,
3030} from "../__fixtures__/workflow_event_group_id"
31+ import { setTimeout as setTimeoutSync } from "timers"
3132import { createScheduled } from "../__fixtures__/workflow_scheduled"
3233
3334jest . setTimeout ( 3000000 )
3435
36+ const failTrap = ( done ) => {
37+ setTimeoutSync ( ( ) => {
38+ // REF:https://stackoverflow.com/questions/78028715/jest-async-test-with-event-emitter-isnt-ending
39+ console . warn (
40+ "Jest is breaking the event emit with its debouncer. This allows to continue the test by managing the timeout of the test manually."
41+ )
42+ done ( )
43+ } , 5000 )
44+ }
45+
3546moduleIntegrationTestRunner < IWorkflowEngineService > ( {
3647 moduleName : Modules . WORKFLOW_ENGINE ,
3748 resolve : __dirname + "/../.." ,
@@ -307,6 +318,8 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
307318 } ,
308319 throwOnError : true ,
309320 } )
321+
322+ failTrap ( done )
310323 } )
311324
312325 it ( "should not run conditional steps if condition is false" , ( done ) => {
@@ -327,6 +340,8 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
327340 } ,
328341 throwOnError : true ,
329342 } )
343+
344+ failTrap ( done )
330345 } )
331346 } )
332347
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ import "../__fixtures__"
1414
1515jest . setTimeout ( 3000000 )
1616
17+ const failTrap = ( done ) => {
18+ setTimeoutSync ( ( ) => {
19+ // REF:https://stackoverflow.com/questions/78028715/jest-async-test-with-event-emitter-isnt-ending
20+ console . warn (
21+ "Jest is breaking the event emit with its debouncer. This allows to continue the test by managing the timeout of the test manually."
22+ )
23+ done ( )
24+ } , 5000 )
25+ }
26+
1727moduleIntegrationTestRunner < IWorkflowEngineService > ( {
1828 moduleName : Modules . WORKFLOW_ENGINE ,
1929 resolve : __dirname + "/../.." ,
@@ -87,6 +97,8 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
8797 expect ( result ) . toBe ( "result from step 0" )
8898 } )
8999 . catch ( ( e ) => e )
100+
101+ failTrap ( done )
90102 } )
91103
92104 it ( "should prevent race continuation of the workflow compensation during retryIntervalAwaiting in background execution" , ( done ) => {
@@ -176,6 +188,8 @@ moduleIntegrationTestRunner<IWorkflowEngineService>({
176188 expect ( result ) . toBe ( "result from step 0" )
177189 } )
178190 . catch ( ( e ) => e )
191+
192+ failTrap ( done )
179193 } )
180194 } )
181195 } ,
You can’t perform that action at this time.
0 commit comments