diff --git a/packages/zwave-js/src/lib/driver/Task.test.ts b/packages/zwave-js/src/lib/driver/Task.test.ts index 5d1a38031c07..41a58922cc70 100644 --- a/packages/zwave-js/src/lib/driver/Task.test.ts +++ b/packages/zwave-js/src/lib/driver/Task.test.ts @@ -1069,13 +1069,9 @@ test("Tasks can be removed while paused, part 2", async (t) => { const order: string[] = []; scheduler.start(); - const t1WasStarted = createDeferredPromise(); - const t2WasStarted = createDeferredPromise(); - const task1 = scheduler.queueTask({ priority: TaskPriority.Normal, task: async function*() { - t1WasStarted.resolve(); order.push("1a"); yield () => wait(10); order.push("1b"); @@ -1091,7 +1087,6 @@ test("Tasks can be removed while paused, part 2", async (t) => { name: "task2", priority: TaskPriority.Normal, task: async function*() { - t2WasStarted.resolve(); order.push("2a"); yield () => wait(10); order.push("2b"); @@ -1103,7 +1098,7 @@ test("Tasks can be removed while paused, part 2", async (t) => { }, }); - await Promise.all([t1WasStarted, t2WasStarted]); + await wait(5); // The tasks have run to the first yield t.expect(order).toStrictEqual(["1a", "2a"]);