Skip to content

Commit 1eba3ca

Browse files
CopilotYunchuWang
andcommitted
Fix incomplete test assertions in Azure-managed E2E tests
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
1 parent d7f7371 commit 1eba3ca

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/e2e-azuremanaged/orchestration.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
8585
const id = await taskHubClient.scheduleNewOrchestration(sequence, 1);
8686
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
8787

88-
expect(state);
88+
expect(state).toBeDefined();
8989
expect(state?.name).toEqual(getName(sequence));
9090
expect(state?.instanceId).toEqual(id);
9191
expect(state?.failureDetails).toBeUndefined();
@@ -120,7 +120,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
120120
const id = await taskHubClient.scheduleNewOrchestration(orchestrator, 10);
121121
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 10);
122122

123-
expect(state);
123+
expect(state).toBeDefined();
124124
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_COMPLETED);
125125
expect(state?.failureDetails).toBeUndefined();
126126
expect(activityCounter).toEqual(10);
@@ -150,7 +150,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
150150
const id = await taskHubClient.scheduleNewOrchestration(orchestratorParent, 10);
151151
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
152152

153-
expect(state);
153+
expect(state).toBeDefined();
154154
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_COMPLETED);
155155
expect(state?.failureDetails).toBeUndefined();
156156
expect(activityCounter).toEqual(1);
@@ -174,7 +174,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
174174
taskHubClient.raiseOrchestrationEvent(id, "C", "c");
175175
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
176176

177-
expect(state);
177+
expect(state).toBeDefined();
178178
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_COMPLETED);
179179
expect(state?.serializedOutput).toEqual(JSON.stringify(["a", "b", "c"]));
180180
});
@@ -199,7 +199,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
199199
const actualCompletionSecond = state?.lastUpdatedAt?.getTime() ?? 0;
200200
expect(actualCompletionSecond).toBeDefined();
201201

202-
expect(state);
202+
expect(state).toBeDefined();
203203
expect(state?.name).toEqual(getName(singleTimer));
204204
expect(state?.instanceId).toEqual(id);
205205
expect(state?.failureDetails).toBeUndefined();
@@ -220,12 +220,12 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
220220

221221
const id = await taskHubClient.scheduleNewOrchestration(orchestrator);
222222
let state = await taskHubClient.waitForOrchestrationStart(id, undefined, 30);
223-
expect(state);
223+
expect(state).toBeDefined();
224224
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_RUNNING);
225225

226226
await taskHubClient.terminateOrchestration(id, "some reason for termination");
227227
state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
228-
expect(state);
228+
expect(state).toBeDefined();
229229
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_TERMINATED);
230230
expect(state?.serializedOutput).toEqual(JSON.stringify("some reason for termination"));
231231
}, 31000);
@@ -245,7 +245,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
245245
const id = await taskHubClient.scheduleNewOrchestration(orchestrator, 1);
246246

247247
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
248-
expect(state);
248+
expect(state).toBeDefined();
249249
expect(state?.runtimeStatus).toEqual(OrchestrationStatus.ORCHESTRATION_STATUS_COMPLETED);
250250
expect(state?.serializedOutput).toEqual(JSON.stringify(10));
251251
}, 31000);
@@ -261,7 +261,7 @@ describe("Durable Task Scheduler (DTS) E2E Tests", () => {
261261
const id = await taskHubClient.scheduleNewOrchestration(orchestrator, 15);
262262
const state = await taskHubClient.waitForOrchestrationCompletion(id, undefined, 30);
263263

264-
expect(state);
264+
expect(state).toBeDefined();
265265
expect(state?.name).toEqual(getName(orchestrator));
266266
expect(state?.instanceId).toEqual(id);
267267
expect(state?.failureDetails).toBeUndefined();

0 commit comments

Comments
 (0)