diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index c7c766ff..923b0a11 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -40,7 +40,7 @@ jobs: with: commands: | npm ci - npm run test + npm run test:cov dir: frontend node_version: "18" sonar_args: > @@ -52,7 +52,8 @@ jobs: -Dsonar.tests.inclusions=**/*spec.ts -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info sonar_token: ${{ secrets[matrix.token] }} - triggers: ${{ matrix.triggers }} + # Only use triggers for PRs + triggers: ${{ github.event_name == 'pull_request' && matrix.triggers || '' }} # https://github.com/marketplace/actions/aqua-security-trivy trivy: diff --git a/frontend/package.json b/frontend/package.json index 0b4f8019..1e96055d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,6 +30,7 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", + "test:cov": "npm run test -- --coverage --watchAll=false", "eject": "react-scripts eject", "lint": "eslint src --ext .ts", "lint:fix": "npm run lint -- --fix"