Skip to content

Commit

Permalink
stricter code coverage checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 17, 2020
1 parent f4a273e commit da911c7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout 🛎
uses: actions/checkout@v1
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
- name: Cypress run 🧪
uses: cypress-io/github-action@v1
with:
start: npm start
wait-on: 'http://localhost:3000'
- name: check code coverage
# nyc does not do very strict code coverage
# the file could be empty and the check would still pass
- name: check code coverage 📈
run: npx nyc report --check-coverage --lines 88
- name: strict code coverage 📊
run: |
npx check-coverage App.tsx
npx check-coverage index.tsx
npx only-covered App.tsx index.tsx utils.tsx
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"extends": "react-app"
},
"nyc": {
"exclude": ["src/serviceWorker.ts"]
"exclude": [
"src/serviceWorker.ts"
]
},
"browserslist": {
"production": [
Expand All @@ -45,6 +47,7 @@
"devDependencies": {
"@cypress/code-coverage": "3.2.2",
"@cypress/instrument-cra": "1.1.0",
"check-code-coverage": "1.0.1",
"cypress": "4.4.0",
"start-server-and-test": "1.10.11"
}
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3582,6 +3582,13 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/check-code-coverage/-/check-code-coverage-1.0.1.tgz#288c3f9576133ca759dbc4b628778f941e42d01b"
integrity sha512-gQ61+sUoChj5krJoIi2CYWqrnLrol7VVRV5XksslabXfX4tle9KqARVuL6NqbcKSa2yQ1eN2kloKDwmib8ut9g==
dependencies:
lodash "4.17.15"

[email protected]:
version "2.24.0"
resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600"
Expand Down

0 comments on commit da911c7

Please sign in to comment.