refactor tests for new constructor pattern
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { API_ERROR_CODE, CopyTradingClient } from '../../src';
|
||||
|
||||
describe('Private Copy Trading REST API GET Endpoints', () => {
|
||||
const useLivenet = true;
|
||||
const API_KEY = process.env.API_KEY_COM;
|
||||
const API_SECRET = process.env.API_SECRET_COM;
|
||||
|
||||
@@ -10,7 +9,11 @@ describe('Private Copy Trading REST API GET Endpoints', () => {
|
||||
expect(API_SECRET).toStrictEqual(expect.any(String));
|
||||
});
|
||||
|
||||
const api = new CopyTradingClient(API_KEY, API_SECRET, useLivenet);
|
||||
const api = new CopyTradingClient({
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
});
|
||||
|
||||
// Don't have copy trading properly enabled on the test account, so testing is very light
|
||||
// (just make sure auth works and endpoint doesn't throw)
|
||||
|
||||
@@ -2,11 +2,14 @@ import { CopyTradingClient } from '../../src';
|
||||
import { successResponseObject } from '../response.util';
|
||||
|
||||
describe('Public Copy Trading REST API Endpoints', () => {
|
||||
const useLivenet = true;
|
||||
const API_KEY = undefined;
|
||||
const API_SECRET = undefined;
|
||||
|
||||
const api = new CopyTradingClient(API_KEY, API_SECRET, useLivenet);
|
||||
const api = new CopyTradingClient({
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
});
|
||||
|
||||
it('getSymbols()', async () => {
|
||||
expect(await api.getSymbols()).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user