Skip to content

Commit 8e67bad

Browse files
add waitForWorkflowStatus util usage, remove type
1 parent fe52ab5 commit 8e67bad

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/core/__test__/executor.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,15 @@ describe("Executor", () => {
134134
version: 1,
135135
});
136136

137-
await new Promise(resolve => setTimeout(resolve, 2000));
138-
const workflowStatusBefore = await executor.getWorkflow(executionId, true);
137+
const workflowStatusBefore = await TestUtil.waitForWorkflowStatus(executor, executionId, "RUNNING");
139138

140-
expect(workflowStatusBefore.status).toEqual("RUNNING");
141139
expect(workflowStatusBefore.tasks?.[0]?.status).toEqual("IN_PROGRESS");
142140

143141
const taskClient = new TaskClient(client);
144142
taskClient.updateTaskResult(executionId, "test_jssdk_http_task_with_asyncComplete_true", "COMPLETED", { hello: "From manuall api call updating task result" });
145143

146-
await new Promise(resolve => setTimeout(resolve, 2000));
147-
const workflowStatusAfter = await executor.getWorkflow(executionId, true);
144+
const workflowStatusAfter = await TestUtil.waitForWorkflowStatus(executor, executionId, "COMPLETED");
148145

149-
expect(workflowStatusAfter.status).toEqual("COMPLETED");
150146
expect(workflowStatusAfter.tasks?.[0]?.status).toEqual("COMPLETED");
151147
});
152148
});

src/core/sdk/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
export const httpTask = (
88
taskReferenceName: string,
99
inputParameters: HttpInputParameters,
10-
asyncComplete: boolean = false
10+
asyncComplete = false
1111
): HttpTaskDef => ({
1212
name: taskReferenceName,
1313
taskReferenceName,

0 commit comments

Comments
 (0)