-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reqHistoricalData tests added #192
Conversation
let ib: IBApi; | ||
const clientId = Math.floor(Math.random() * 32766) + 1; // ensure unique client | ||
|
||
beforeEach(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 4 locations. Consider refactoring.
// logger.info("IBApi disconnected"); | ||
}); | ||
|
||
it("Stock market data", (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
ib.connect(); | ||
}); | ||
|
||
it("Monthly market data", (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
ib.connect(); | ||
}); | ||
|
||
it("Weekly market data", (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
@@ -0,0 +1,318 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File historical-data.test.ts
has 253 lines of code (exceeds 250 allowed). Consider refactoring.
const refId = 4; | ||
let count = 0; | ||
|
||
ib.once(EventName.nextValidId, (_reqId) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -0,0 +1,335 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File historical-data.test.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring.
.catch((err: IBApiNextError) => { | ||
this.error(`getAllOpenOrders failed with '${err}'`); | ||
}); | ||
this.subscription$ = this.api.getOpenOrders().subscribe({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
if (error.reqId === -1) { | ||
console.warn(`${error.error.message} (Error #${error.code})`); | ||
} else { | ||
console.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 2 locations. Consider refactoring.
import { Subscription } from "rxjs"; | ||
import { IBApiNext, IBApiNextError } from "../../.."; | ||
|
||
const _awaitTimeout = (delay: number): Promise<unknown> => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
ib.connect().reqMarketDataType(MarketDataType.DELAYED_FROZEN); | ||
}); | ||
|
||
it("SPY market data", (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
ib.connect().reqMarketDataType(MarketDataType.DELAYED_FROZEN); | ||
}); | ||
|
||
it("Index market data", (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
@@ -1093,7 +1096,7 @@ export class IBApi extends EventEmitter { | |||
* - 3 (delayed) enables delayed and disables delayed-frozen market data. | |||
* - 4 (delayed-frozen) enables delayed and delayed-frozen market data. | |||
*/ | |||
reqMarketDataType(marketDataType: number): IBApi { | |||
reqMarketDataType(marketDataType: MarketDataType): IBApi { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit b4426b2 and detected 22 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.