diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4047ca52..f8bf7720 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 62a149e9..acfc9597 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 d940d1b4..dee69fea 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,