From 5c1b4ff34018386517b0c65a594a24466b12db24 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:29:34 +0200 Subject: [PATCH] feat(): Added public tests --- test/CBExchangeClient/public.test.ts | 20 ++++++++++++++++++++ test/CBInternationalClient/public.test.ts | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/CBExchangeClient/public.test.ts create mode 100644 test/CBInternationalClient/public.test.ts diff --git a/test/CBExchangeClient/public.test.ts b/test/CBExchangeClient/public.test.ts new file mode 100644 index 0000000..c330c03 --- /dev/null +++ b/test/CBExchangeClient/public.test.ts @@ -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), + }); + }); + }); +}); diff --git a/test/CBInternationalClient/public.test.ts b/test/CBInternationalClient/public.test.ts new file mode 100644 index 0000000..4ff15a9 --- /dev/null +++ b/test/CBInternationalClient/public.test.ts @@ -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), + }); + }); + }); +});