diff --git a/src/tests/unit/api-next/subscription-registry.test.ts b/src/tests/unit/api-next/subscription-registry.test.ts index 29e380c7..6781a41a 100644 --- a/src/tests/unit/api-next/subscription-registry.test.ts +++ b/src/tests/unit/api-next/subscription-registry.test.ts @@ -49,6 +49,10 @@ describe("Subscription registry Tests", () => { next: (data) => { console.log(data); }, + complete: () => { + console.log("getOpenOrders completed."); + done(); + }, error: (err: IBApiNextError) => { console.error(`getOpenOrders failed with '${err.error.message}'`); }, @@ -58,7 +62,7 @@ describe("Subscription registry Tests", () => { .getAllOpenOrders() .then((orders) => { console.log(orders); - done(); + subscription$.unsubscribe(); }) .catch((err: IBApiNextError) => { console.error(`getAllOpenOrders failed with '${err}'`); diff --git a/src/tests/unit/api/connect.test.ts b/src/tests/unit/api/connect.test.ts index b8400dc0..d20c5f79 100644 --- a/src/tests/unit/api/connect.test.ts +++ b/src/tests/unit/api/connect.test.ts @@ -3,7 +3,7 @@ import { EventName } from "../../../api/data/enum/event-name"; import configuration from "../../../common/configuration"; describe("IBApi connection Tests", () => { - jest.setTimeout(10000); + jest.setTimeout(5 * 1000); let ib: IBApi; const clientId = Math.floor(Math.random() * 32766) + 1; // ensure unique client