cleaning and expand public api tests

This commit is contained in:
tiagosiebler
2021-06-24 00:41:21 +01:00
parent ef427f524a
commit bbdf6edad9
6 changed files with 152 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import { InverseClient } from "../../src/inverse-client";
import { successResponseList, successResponseObject } from "../response.util";
import { notAuthenticatedError, successResponseList, successResponseObject } from "../response.util";
describe('Public Inverse REST API Endpoints', () => {
const useLivenet = true;
@@ -12,7 +12,7 @@ describe('Public Inverse REST API Endpoints', () => {
describe('Inverse only endpoints', () => {
it('should throw for unauthenticated private calls', async () => {
expect(() => api.getPosition()).rejects.toMatchObject(new Error('Private endpoints require api and private keys set'));
expect(() => api.getPosition()).rejects.toMatchObject(notAuthenticatedError());
});
it('getKline()', async () => {
@@ -40,7 +40,7 @@ describe('Public Inverse REST API Endpoints', () => {
describe('Shared endpoints', () => {
it('should throw for unauthenticated private calls', async () => {
expect(() => api.getApiKeyInfo()).rejects.toMatchObject(new Error('Private endpoints require api and private keys set'));
expect(() => api.getApiKeyInfo()).rejects.toMatchObject(notAuthenticatedError());
});
it('getOrderBook()', async () => {