Skip to content

Commit

Permalink
[chore] Fix cover script generate cover report (#2609)
Browse files Browse the repository at this point in the history
- generate tape test cover report with yarn cover-tape
- generate jest test cover report with yarn cover-jest
- merge json report with istanbul-merge
- generate final report with nyc
- coverall report back to 71%
- Fix cover and netlify badge in readme

---------

Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
heshan0131 authored Aug 20, 2024
1 parent affc5b6 commit 4000544
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
<img src='https://app.fossa.com/api/projects/custom%2B4458%2Fgit.luolix.top%2Fkeplergl%2Fkepler.gl.svg?type=shield' alt='Fossa' />
</a>
<a href="https://app.netlify.com/sites/keplergl/deploys" alt="Netlify Status">
<img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fdeveloper.oswaldlabs.com%2Fnetlify-status%2F0c9b895c-acd0-43fd-8af7-fe960181b686?style=flat" />
<img src="https://api.netlify.com/api/v1/badges/0c9b895c-acd0-43fd-8af7-fe960181b686/deploy-status" />
</a>
<a href='https://coveralls.io/github/keplergl/kepler.gl?branch=master'>
<img src='https://coveralls.io/repos/github/keplergl/kepler.gl/badge.svg?branch=master' alt='Coverage Status' />
</a>
</p>

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@
"test-jest": "jest",
"test-tape": "yarn test-node && yarn test-browser",
"test": "yarn test-jest && yarn test-tape",
"cover-tape": "nyc --reporter=json --report-dir=tape-coverage --reporter=html yarn test-tape",
"cover-jest": "yarn jest --coverage --reporter=html --watchAll=false",
"cover-copy-tape": "yarn nyc merge tape-coverage .nyc_output/coverage.json",
"cover-copy-jest": "yarn nyc merge jest-coverage .nyc_output/coverage.json",
"cover-copy": "rm -rf .nyc_output && mkdir .nyc_output && yarn cover-copy-tape && yarn cover-copy-jest",
"cover": "yarn cover-jest && yarn cover-tape && yarn cover-copy && nyc report --reporter=json --reporter=html --reporter=lcov",
"cover": "yarn cover-tape && yarn cover-jest && yarn cover-merge && yarn cover-report",
"cover-tape": "nyc --reporter=json --report-dir=tape-coverage --reporter=lcov yarn test-tape",
"cover-jest": "jest --coverage --reporter=lcov --watchAll=false",
"cover-merge": "istanbul-merge --out=coverage/coverage-all.json tape-coverage/coverage-final.json jest-coverage/coverage-final.json",
"cover-report": "nyc report -t coverage --report-dir coverage --reporter=json --reporter=lcov",
"start": "NODE_OPTIONS=--openssl-legacy-provider yarn install-and-start -- examples/demo-app start-local",
"start:deck": "NODE_OPTIONS=--openssl-legacy-provider yarn install-and-start -- examples/demo-app start-local-deck",
"start:deck-src": "NODE_OPTIONS=--openssl-legacy-provider yarn install-and-start -- examples/demo-app start-local-deck-src",
Expand Down Expand Up @@ -181,6 +180,7 @@
"eslint-plugin-react-hooks": "^4.6.2",
"gl": "^6.0.2",
"global": "^4.4.0",
"istanbul-merge": "^2.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^24.1.1",
Expand Down
3 changes: 3 additions & 0 deletions test/helpers/mock-provider.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project

// SPDX-License-Identifier: MIT
// Copyriht contributors to the kepler.gl project

Expand Down
18 changes: 15 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4715,7 +4715,7 @@ array.prototype.flat@^1.2.3, array.prototype.flat@^1.3.1, array.prototype.flat@^
es-abstract "^1.22.1"
es-shim-unscopables "^1.0.0"

array.prototype.flatmap@^1.3.2:
array.prototype.flatmap@^1.3.1, array.prototype.flatmap@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527"
integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==
Expand Down Expand Up @@ -9154,7 +9154,7 @@ glob@^6.0.4:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0, glob@~7.2.3:
glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0, glob@^7.2.3, glob@~7.2.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand Down Expand Up @@ -10717,6 +10717,18 @@ istanbul-lib-source-maps@^4.0.0:
istanbul-lib-coverage "^3.0.0"
source-map "^0.6.1"

istanbul-merge@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/istanbul-merge/-/istanbul-merge-2.0.0.tgz#996c93e8591315584775b7685ff6b679aec572b6"
integrity sha512-Y812/uTdnF5Qc2qWxA7jQOTkqpFLEr7BHy8mzUQFRJstTjPigNS1Bh3q06AbOhBZ7tZqrI4MZdMgG34KVnUn6w==
dependencies:
array.prototype.flatmap "^1.3.1"
for-each "^0.3.3"
glob "^7.2.3"
istanbul-lib-coverage "^3.2.0"
mkdirp "^0.5.6"
yargs "^15.4.1"

istanbul-reports@^3.0.2, istanbul-reports@^3.1.3:
version "3.1.7"
resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b"
Expand Down Expand Up @@ -18259,7 +18271,7 @@ yargs@^13.3.2:
y18n "^4.0.0"
yargs-parser "^13.1.2"

yargs@^15.0.2:
yargs@^15.0.2, yargs@^15.4.1:
version "15.4.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
Expand Down

0 comments on commit 4000544

Please sign in to comment.