From c10a1f0d67ac1c5a5aa7c033b27264579a512b9e Mon Sep 17 00:00:00 2001 From: vidit kushwaha Date: Sun, 30 Jun 2024 12:20:44 +0530 Subject: [PATCH] Updated jest Config: adding coverage --- .github/workflows/build.yaml | 13 ++++++------- jest.config.ts | 3 +++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 861c94f..54dd2bf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,22 +5,21 @@ on: [pull_request, push] jobs: build: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v2 - name: Install node uses: actions/setup-node@v1 with: - node-version: '18.x' + node-version: '18.x' - name: Install dependencies - run: npm install + run: npm install - name: Test run: npm run test - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} \ No newline at end of file + - run: npx coveralls < coverage/lcov.info + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/jest.config.ts b/jest.config.ts index ed8ef6a..82f42d7 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -16,5 +16,8 @@ const config: Config.InitialOptions = { '\\.(css|less|sass|scss)$': 'identity-obj-proxy', '^.+\\.svg$': 'jest-transformer-svg', }, + collectCoverage: true, + coverageReporters: ['lcov', 'text'], + coverageDirectory: './coverage' } export default config