diff --git a/.github/workflows/jest-coverage-report.yml b/.github/workflows/jest-coverage-report.yml new file mode 100644 index 0000000..4f76acb --- /dev/null +++ b/.github/workflows/jest-coverage-report.yml @@ -0,0 +1,19 @@ +name: Jest Coverage Report + +on: [pull_request] + +jobs: + jest-coverage-report: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + + - name: Coverage Report + uses: ArtiomTr/jest-coverage-report-action@v2 diff --git a/.husky/pre-push b/.husky/pre-push index 9c7ed53..508bc3e 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm run test \ No newline at end of file +npm run coverage \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 11efce8..6fc0d4a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,6 +3,11 @@ module.exports = { testPathIgnorePatterns: ['/node_modules/', '/lib/'], coveragePathIgnorePatterns: ['/src/index.ts'], collectCoverageFrom: ['./src/**/*.ts'], + coverageThreshold: { + global: { + lines: 95, + }, + }, preset: 'ts-jest', testEnvironment: 'node', verbose: true,