From 9d84e2c7d1fb9f3026d7b5a57778eb42c29711ac Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Tue, 17 Dec 2024 16:54:21 -0300 Subject: [PATCH] chore: upload test coverage to coveralls --- .github/workflows/ci.yml | 8 +++++++- package.json | 2 +- src/lib/helpers.ts | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4047ca52b..f8bf77200 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: ['18', '20'] + node: ["18", "20"] runs-on: ${{ matrix.os }} @@ -35,3 +35,9 @@ jobs: - name: Run tests run: | npm t + + - name: Upload coverage results to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./test/coverage/lcov.info diff --git a/package.json b/package.json index 62a149e99..acfc95977 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build:module": "tsc -p tsconfig.module.json", "lint": "eslint ./src/**/* test/**/*.test.ts", "test": "run-s test:clean test:infra test:suite test:clean", - "test:suite": "jest --runInBand", + "test:suite": "jest --runInBand --coverage", "test:infra": "cd infra && docker compose down && docker compose pull && docker compose up -d && sleep 30", "test:clean": "cd infra && docker compose down", "docs": "typedoc src/index.ts --out docs/v2 --excludePrivate --excludeProtected", diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index d940d1b42..dee69fea9 100644 --- a/src/lib/helpers.ts +++ b/src/lib/helpers.ts @@ -14,8 +14,7 @@ export function uuid() { }) } -export const isBrowser = () => - typeof window !== 'undefined' && typeof document !== 'undefined' +export const isBrowser = () => typeof window !== 'undefined' && typeof document !== 'undefined' const localStorageWriteTests = { tested: false,