From 51d9131f170dc9f4329a3a18494618f3f5d33c78 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Sat, 15 Mar 2025 12:05:51 +0100 Subject: [PATCH] feat(): separated private and public tests --- .github/workflows/e2etests.yml | 9 ++++++--- package.json | 2 ++ test/ws.private.test.ts | 2 +- test/ws.public.test.ts | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2etests.yml b/.github/workflows/e2etests.yml index 09a3def..90a8c89 100644 --- a/.github/workflows/e2etests.yml +++ b/.github/workflows/e2etests.yml @@ -7,7 +7,7 @@ on: jobs: build: - name: "Build & Test" + name: "Build, Lint & Test" runs-on: ubuntu-latest steps: @@ -32,8 +32,11 @@ jobs: - name: Check Lint run: npm run lint - - name: Test - run: npm run test + - name: Run Public Tests + run: npm run test:public + + - name: Run Private Tests + run: npm run test:private env: API_KEY_COM: ${{ secrets.API_KEY_COM }} API_SECRET_COM: ${{ secrets.API_SECRET_COM }} diff --git a/package.json b/package.json index ea958e9..7c2a286 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "scripts": { "test": "jest", "test:watch": "jest --watch", + "test:public": "jest --testPathIgnorePatterns='.*private.*'", + "test:private": "jest --testPathPattern='.*private.*'", "clean": "rm -rf lib dist", "build": "tsc", "build:clean": "npm run clean && npm run build", diff --git a/test/ws.private.test.ts b/test/ws.private.test.ts index c62fd95..3ea6c56 100644 --- a/test/ws.private.test.ts +++ b/test/ws.private.test.ts @@ -90,7 +90,7 @@ describe.skip('Private Spot Websocket Client', () => { event: 'login', }); } catch (e) { - console.error(`Wait for "books" subscription response exception: `, e); + console.error('Wait for "books" subscription response exception: ', e); expect(e).toBeFalsy(); } }); diff --git a/test/ws.public.test.ts b/test/ws.public.test.ts index 63c4c7f..1fa1ec7 100644 --- a/test/ws.public.test.ts +++ b/test/ws.public.test.ts @@ -50,7 +50,7 @@ describe('Public Spot Websocket Client', () => { wsKey: WS_KEY_MAP.spotv1, }); } catch (e) { - console.error(`Wait for "books" subscription response exception: `, e); + console.error('Wait for "books" subscription response exception: ', e); expect(e).toBeFalsy(); } @@ -67,7 +67,7 @@ describe('Public Spot Websocket Client', () => { wsKey: 'spotv1', }); } catch (e) { - console.error(`Wait for "books" event exception: `, e); + console.error('Wait for "books" event exception: ', e); expect(e).toBeFalsy(); } });