Skip to content

Commit

Permalink
Merge pull request #27 from tiagosiebler/jerko
Browse files Browse the repository at this point in the history
feat(): Added public  tests
  • Loading branch information
JJ-Cro authored Sep 19, 2024
2 parents f171f73 + 5c1b4ff commit d15e502
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/CBExchangeClient/public.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { CBExchangeClient } from '../../src/index.js';

describe('CBExchangeClient PUBLIC', () => {
const rest = new CBExchangeClient();

describe('public endpoints', () => {
it('should succeed making a GET request', async () => {
const res = await rest.getProductBook({ product_id: 'BTC-USDT' });
console.log(res);
expect(res).toMatchObject({
bids: expect.any(Array),
asks: expect.any(Array),
sequence: expect.any(Number),
auction_mode: expect.any(Boolean),
auction: expect.any(Object),
time: expect.any(String),
});
});
});
});
18 changes: 18 additions & 0 deletions test/CBInternationalClient/public.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CBInternationalClient } from '../../src/index.js';

describe('CBInternationalClient PUBLIC', () => {
const rest = new CBInternationalClient();

describe('public endpoints', () => {
it('should succeed making a GET request', async () => {
const res = await rest.getHistoricalFundingRates({
instrument: 'BTC-PERP',
});
console.log(res);
expect(res).toMatchObject({
pagination: expect.any(Object),
results: expect.any(Array),
});
});
});
});

0 comments on commit d15e502

Please sign in to comment.