From f1cb2a35b73a00c79a5d914f3a044183ecb09f95 Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Sat, 20 Mar 2021 19:28:10 +0530 Subject: [PATCH] Add jest coverage diff reporting action (#3651) --- .github/workflows/client-build.yml | 6 +++++- app/client/package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 7536baa8eb..521d03e48d 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -93,7 +93,11 @@ jobs: echo ::set-output name=version::$next_version-SNAPSHOT - name: Run the jest tests - run: REACT_APP_ENVIRONMENT=${{steps.vars.outputs.REACT_APP_ENVIRONMENT}} yarn run test:unit + uses: anuraag016/Jest-Coverage-Diff@V1.1 + with: + fullCoverageDiff: false + runCommand: cd app/client && REACT_APP_ENVIRONMENT=${{steps.vars.outputs.REACT_APP_ENVIRONMENT}} yarn run test:unit + delta: 0.5 # We burn React environment & the Segment analytics key into the build itself. # This is to ensure that we don't need to configure it in each installation diff --git a/app/client/package.json b/app/client/package.json index b09ee5139a..36f964bd01 100644 --- a/app/client/package.json +++ b/app/client/package.json @@ -142,7 +142,7 @@ "eject": "react-scripts eject", "start-prod": "REACT_APP_ENVIRONMENT=PRODUCTION craco start", "cytest": "REACT_APP_TESTING=TESTING REACT_APP_ENVIRONMENT=DEVELOPMENT craco start & ./node_modules/.bin/cypress open", - "test:unit": "$(npm bin)/jest -b --colors --no-cache", + "test:unit": "$(npm bin)/jest -b --colors --no-cache --coverage --collectCoverage=true --coverageDirectory='./' --coverageReporters='json-summary'", "storybook": "start-storybook -p 9009 -s public", "build-storybook": "build-storybook -s public" },