From 47f74cb7dcab0e7c264d6b0b88899b5e7859b26e Mon Sep 17 00:00:00 2001 From: Ronan-Yann Lorin Date: Mon, 23 Oct 2023 19:48:57 +0200 Subject: [PATCH] Minor changes to test case --- src/tests/unit/api-next/subscription-registry.test.ts | 6 +++++- src/tests/unit/api/connect.test.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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