Update alpaca actions test to test date.
This commit is contained in:
parent
34bcafb07f
commit
960285e503
@ -1,6 +1,6 @@
|
|||||||
import { describe, expect, test } from '@jest/globals';
|
import { describe, expect, test } from '@jest/globals';
|
||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import { ActionFetchOptions, AlpacaExchange } from '../src/index';
|
import { ActionDateOptions, ActionDateType, ActionFetchOptions, AlpacaExchange } from '../src/index';
|
||||||
import { createLogger, transports, format } from "winston";
|
import { createLogger, transports, format } from "winston";
|
||||||
|
|
||||||
const timeout = 10000;
|
const timeout = 10000;
|
||||||
@ -39,12 +39,12 @@ describe('Alpaca Tests', () => {
|
|||||||
expect(process.env.ALPACA_SECRET_KEY).toBeDefined();
|
expect(process.env.ALPACA_SECRET_KEY).toBeDefined();
|
||||||
const exchange = new AlpacaExchange(process.env.ALPACA_API_KEY!, process.env.ALPACA_SECRET_KEY!, true);
|
const exchange = new AlpacaExchange(process.env.ALPACA_API_KEY!, process.env.ALPACA_SECRET_KEY!, true);
|
||||||
|
|
||||||
const fetchOptions = {};
|
const fetchOptions = new ActionFetchOptions(undefined, new ActionDateOptions(new Date("2023-10-23T13:30:28.163Z"), ActionDateType.On));
|
||||||
|
|
||||||
const response = await exchange.actionProvider.fetchActions(new ActionFetchOptions());
|
const response = await exchange.actionProvider.fetchActions(fetchOptions);
|
||||||
|
|
||||||
logger.info(JSON.stringify(response));
|
logger.info(JSON.stringify(response));
|
||||||
|
|
||||||
await expect(exchange.actionProvider.fetchActions(new ActionFetchOptions())).resolves.toBeDefined();
|
await expect(exchange.actionProvider.fetchActions(fetchOptions)).resolves.toBeDefined();
|
||||||
}, timeout);
|
}, timeout);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user