chore(): route tests via proxy instead of github CI address
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { USDCPerpetualClient } from '../../../src';
|
||||
import { getTestProxy } from '../../proxy.util';
|
||||
import { successResponseObjectV3 } from '../../response.util';
|
||||
|
||||
describe('Private USDC Perp REST API GET Endpoints', () => {
|
||||
@@ -10,36 +11,39 @@ describe('Private USDC Perp REST API GET Endpoints', () => {
|
||||
expect(API_SECRET).toStrictEqual(expect.any(String));
|
||||
});
|
||||
|
||||
const api = new USDCPerpetualClient({
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
});
|
||||
const api = new USDCPerpetualClient(
|
||||
{
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
},
|
||||
getTestProxy(),
|
||||
);
|
||||
|
||||
const symbol = 'BTCPERP';
|
||||
const category = 'PERPETUAL';
|
||||
|
||||
it('getActiveOrders()', async () => {
|
||||
expect(await api.getActiveOrders({ category })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getHistoricOrders()', async () => {
|
||||
expect(await api.getHistoricOrders({ category })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getOrderExecutionHistory()', async () => {
|
||||
expect(await api.getOrderExecutionHistory({ category })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getTransactionLog()', async () => {
|
||||
expect(await api.getTransactionLog({ type: 'TRADE' })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -57,19 +61,19 @@ describe('Private USDC Perp REST API GET Endpoints', () => {
|
||||
|
||||
it('getPositions()', async () => {
|
||||
expect(await api.getPositions({ category })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getSettlementHistory()', async () => {
|
||||
expect(await api.getSettlementHistory({ symbol })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getPredictedFundingRate()', async () => {
|
||||
expect(await api.getPredictedFundingRate(symbol)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { API_ERROR_CODE, USDCPerpetualClient } from '../../../src';
|
||||
import { getTestProxy } from '../../proxy.util';
|
||||
import { successEmptyResponseObjectV3 } from '../../response.util';
|
||||
|
||||
describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
@@ -10,11 +11,14 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
expect(API_SECRET).toStrictEqual(expect.any(String));
|
||||
});
|
||||
|
||||
const api = new USDCPerpetualClient({
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
});
|
||||
const api = new USDCPerpetualClient(
|
||||
{
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
},
|
||||
getTestProxy(),
|
||||
);
|
||||
|
||||
const symbol = 'BTCPERP';
|
||||
|
||||
@@ -29,7 +33,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
orderPrice: '20000',
|
||||
orderLinkId: Date.now().toString(),
|
||||
timeInForce: 'GoodTillCancel',
|
||||
})
|
||||
}),
|
||||
).toMatchObject({
|
||||
retCode: API_ERROR_CODE.INSUFFICIENT_BALANCE_FOR_ORDER_COST,
|
||||
});
|
||||
@@ -42,7 +46,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
orderId: 'somethingFake',
|
||||
orderPrice: '20000',
|
||||
orderFilter: 'Order',
|
||||
})
|
||||
}),
|
||||
).toMatchObject({
|
||||
retCode: API_ERROR_CODE.ORDER_NOT_FOUND_OR_TOO_LATE,
|
||||
});
|
||||
@@ -54,7 +58,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
symbol,
|
||||
orderId: 'somethingFake1',
|
||||
orderFilter: 'Order',
|
||||
})
|
||||
}),
|
||||
).toMatchObject({
|
||||
retCode: API_ERROR_CODE.ORDER_NOT_FOUND_OR_TOO_LATE,
|
||||
});
|
||||
@@ -62,7 +66,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
|
||||
it('cancelActiveOrders()', async () => {
|
||||
expect(await api.cancelActiveOrders(symbol, 'Order')).toMatchObject(
|
||||
successEmptyResponseObjectV3()
|
||||
successEmptyResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -72,7 +76,7 @@ describe('Private USDC Perp REST API POST Endpoints', () => {
|
||||
{
|
||||
retCode: API_ERROR_CODE.SET_MARGIN_MODE_FAILED_USDC,
|
||||
retMsg: '',
|
||||
}
|
||||
},
|
||||
// successResponseObjectV3()
|
||||
);
|
||||
});
|
||||
|
||||
@@ -3,16 +3,20 @@ import {
|
||||
successResponseObject,
|
||||
successResponseObjectV3,
|
||||
} from '../../response.util';
|
||||
import { getTestProxy } from '../../proxy.util';
|
||||
|
||||
describe('Public USDC Perp REST API Endpoints', () => {
|
||||
const API_KEY = undefined;
|
||||
const API_SECRET = undefined;
|
||||
|
||||
const api = new USDCPerpetualClient({
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
});
|
||||
const api = new USDCPerpetualClient(
|
||||
{
|
||||
key: API_KEY,
|
||||
secret: API_SECRET,
|
||||
testnet: false,
|
||||
},
|
||||
getTestProxy(),
|
||||
);
|
||||
|
||||
const symbol = 'BTCPERP';
|
||||
const category = 'PERPETUAL';
|
||||
@@ -22,73 +26,73 @@ describe('Public USDC Perp REST API Endpoints', () => {
|
||||
|
||||
it('getOrderBook()', async () => {
|
||||
expect(await api.getOrderBook(symbol)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getContractInfo()', async () => {
|
||||
expect(await api.getContractInfo()).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getSymbolTicker()', async () => {
|
||||
expect(await api.getSymbolTicker(symbol)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getCandles()', async () => {
|
||||
expect(await api.getCandles(candleRequest)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getMarkPrice()', async () => {
|
||||
expect(await api.getMarkPrice(candleRequest)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getIndexPrice()', async () => {
|
||||
expect(await api.getIndexPrice(candleRequest)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getIndexPremium()', async () => {
|
||||
expect(await api.getIndexPremium(candleRequest)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getOpenInterest()', async () => {
|
||||
expect(await api.getOpenInterest({ symbol, period: '1m' })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getLargeOrders()', async () => {
|
||||
expect(await api.getLargeOrders({ symbol })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getLongShortRatio()', async () => {
|
||||
expect(await api.getLongShortRatio({ symbol, period: '1m' })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getLast500Trades()', async () => {
|
||||
expect(await api.getLast500Trades({ category })).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
it('getLastFundingRate()', async () => {
|
||||
expect(await api.getLastFundingRate(symbol)).toMatchObject(
|
||||
successResponseObjectV3()
|
||||
successResponseObjectV3(),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user