refactor tests for new constructor pattern

This commit is contained in:
tiagosiebler
2022-09-19 23:48:35 +01:00
parent f7d59b48c1
commit d3fa937cdf
30 changed files with 160 additions and 102 deletions

View File

@@ -2,7 +2,6 @@ import { SpotClient } from '../../src';
import { errorResponseObject, successResponseList } from '../response.util';
describe('Private Spot REST API GET Endpoints', () => {
const useLivenet = true;
const API_KEY = process.env.API_KEY_COM;
const API_SECRET = process.env.API_SECRET_COM;
@@ -11,7 +10,11 @@ describe('Private Spot REST API GET Endpoints', () => {
expect(API_SECRET).toStrictEqual(expect.any(String));
});
const api = new SpotClient(API_KEY, API_SECRET, useLivenet);
const api = new SpotClient({
key: API_KEY,
secret: API_SECRET,
testnet: false,
});
it('getOrder()', async () => {
// No auth error == test pass

View File

@@ -2,7 +2,6 @@ import { API_ERROR_CODE, SpotClient } from '../../src';
import { successResponseObject } from '../response.util';
describe('Private Spot REST API POST Endpoints', () => {
const useLivenet = true;
const API_KEY = process.env.API_KEY_COM;
const API_SECRET = process.env.API_SECRET_COM;
@@ -11,7 +10,11 @@ describe('Private Spot REST API POST Endpoints', () => {
expect(API_SECRET).toStrictEqual(expect.any(String));
});
const api = new SpotClient(API_KEY, API_SECRET, useLivenet);
const api = new SpotClient({
key: API_KEY,
secret: API_SECRET,
testnet: false,
});
// Warning: if some of these start to fail with 10001 params error, it's probably that this future expired and a newer one exists with a different symbol!
const symbol = 'BTCUSDT';

View File

@@ -6,7 +6,6 @@ import {
} from '../response.util';
describe('Private Spot REST API GET Endpoints', () => {
const useLivenet = true;
const API_KEY = process.env.API_KEY_COM;
const API_SECRET = process.env.API_SECRET_COM;
@@ -15,7 +14,11 @@ describe('Private Spot REST API GET Endpoints', () => {
expect(API_SECRET).toStrictEqual(expect.any(String));
});
const api = new SpotClientV3(API_KEY, API_SECRET, useLivenet);
const api = new SpotClientV3({
key: API_KEY,
secret: API_SECRET,
testnet: false,
});
const symbol = 'BTCUSDT';
const interval = '15m';

View File

@@ -2,7 +2,6 @@ import { API_ERROR_CODE, SpotClientV3 } from '../../src';
import { successResponseObjectV3 } from '../response.util';
describe('Private Spot REST API POST Endpoints', () => {
const useLivenet = true;
const API_KEY = process.env.API_KEY_COM;
const API_SECRET = process.env.API_SECRET_COM;
@@ -11,7 +10,11 @@ describe('Private Spot REST API POST Endpoints', () => {
expect(API_SECRET).toStrictEqual(expect.any(String));
});
const api = new SpotClientV3(API_KEY, API_SECRET, useLivenet);
const api = new SpotClientV3({
key: API_KEY,
secret: API_SECRET,
testnet: false,
});
const symbol = 'BTCUSDT';
const ltCode = 'BTC3S';