Use an interface for AlpacaActivity and add date checks to tests.
This commit is contained in:
@ -43,8 +43,21 @@ describe('Alpaca Tests', () => {
|
||||
|
||||
const response = await exchange.actionProvider.fetchActions(fetchOptions);
|
||||
|
||||
expect(response).toBeDefined();
|
||||
|
||||
logger.info(JSON.stringify(response));
|
||||
|
||||
await expect(exchange.actionProvider.fetchActions(fetchOptions)).resolves.toBeDefined();
|
||||
for (const action of response.actions) {
|
||||
expect(action).toBeDefined();
|
||||
expect(action.symbol).toBeDefined();
|
||||
expect(action.quantity).toBeDefined();
|
||||
expect(action.side).toBeDefined();
|
||||
expect(action.pricePerShare).toBeDefined();
|
||||
|
||||
expect(action.timestamp).toBeDefined();
|
||||
expect(action.timestamp.getFullYear()).toBe(2023);
|
||||
expect(action.timestamp.getMonth()).toBe(9);
|
||||
expect(action.timestamp.getDate()).toBe(23);
|
||||
}
|
||||
}, timeout);
|
||||
});
|
||||
|
Reference in New Issue
Block a user