Skip to content

Commit

Permalink
Tests update
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed May 8, 2024
1 parent 94c41bf commit e40cb11
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2995,6 +2995,8 @@ export declare interface IBApi {
price: number,
size: number,
tickAttribLast: unknown /* TODO: replace with TickAttribLast type as soon as available. */,
exchange: string,
specialConditions: string,
) => void,
): this;

Expand Down
12 changes: 6 additions & 6 deletions src/tests/unit/api/historical-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("IBApi Historical data Tests", () => {
ib.reqHistoricalData(
refId,
contract,
"20240110-20:00:00",
"20240508-17:00:00",
"30 S",
BarSizeSetting.SECONDS_FIFTEEN,
WhatToShow.BID_ASK,
Expand Down Expand Up @@ -153,11 +153,11 @@ describe("IBApi Historical data Tests", () => {
expect(counter).toEqual(2);
done();
} else if (counter++ == 1) {
expect(time).toEqual("1704916785");
expect(open).toEqual(25.65);
expect(high).toEqual(25.65);
expect(low).toEqual(25.65);
expect(close).toEqual(25.65);
expect(time).toEqual("1715187585");
expect(open).toEqual(25.35);
expect(high).toEqual(25.35);
expect(low).toEqual(25.35);
expect(close).toEqual(25.35);
expect(volume).toEqual(-1);
expect(count).toEqual(-1);
expect(WAP).toEqual(-1);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/unit/api/order/placeConditionalOrder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
PercentChangeCondition,
PriceCondition,
TimeCondition,
TimeInForce,
TriggerMethod,
VolumeCondition,
} from "../../../..";
Expand Down Expand Up @@ -95,6 +96,7 @@ describe("Place Conditional Orders", () => {
conditionsIgnoreRth: true,
conditionsCancelOrder: false,
conditions: [sample_price_condition],
tif: TimeInForce.DAY,
transmit: true,
};

Expand Down
4 changes: 2 additions & 2 deletions src/tests/unit/sample-data/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const sample_crypto: Contract = new Crypto("ETH");
// This one will need to be updated sometimes
export const sample_future: Contract = new Future(
"ES",
"ESH4",
"202403",
"ESM4",
"202406",
"CME",
50,
);
Expand Down

0 comments on commit e40cb11

Please sign in to comment.