Skip to content

Commit

Permalink
coverage: replace istanbul with nyc
Browse files Browse the repository at this point in the history
* current istanbul coverage tests fail to run
* istanbul's last release was 8 years ago
* istanbul npm page recomments using nyc
  • Loading branch information
alxndrsn committed Apr 29, 2024
1 parent 84b7afb commit f4bfb5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[PouchDB](https://pouchdb.com/) – The Database that Syncs!
=========

[![Build Status](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml?query=branch%3Amaster) [![Coverage Status](https://s3.amazonaws.com/assets.coveralls.io/badges/coveralls_100.svg)](https://coveralls.io/github/pouchdb/pouchdb?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/pouchdb/pouchdb.svg)](https://greenkeeper.io/) [![npm version](https://img.shields.io/npm/v/pouchdb.svg)](https://www.npmjs.com/package/pouchdb) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/pouchdb/badge?style=rounded)](https://www.jsdelivr.com/package/npm/pouchdb)
[![Build Status](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml?query=branch%3Amaster) [![Greenkeeper badge](https://badges.greenkeeper.io/pouchdb/pouchdb.svg)](https://greenkeeper.io/) [![npm version](https://img.shields.io/npm/v/pouchdb.svg)](https://www.npmjs.com/package/pouchdb) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/pouchdb/badge?style=rounded)](https://www.jsdelivr.com/package/npm/pouchdb)

PouchDB is an open-source JavaScript database inspired by [Apache CouchDB](http://couchdb.apache.org/) that is designed to run well within the browser.

Expand Down
15 changes: 7 additions & 8 deletions bin/test-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ fi
if [ $TYPE = "find" ]; then
TESTS_PATH="tests/find/*/test.*.js"
fi
if [ "$COVERAGE" ]; then
# run all tests when testing for coverage
TESTS_PATH="tests/{unit,integration,mapreduce,component}/test*.js tests/find/*/test.*.js"
fi

if [ "$PERF" ]; then
node tests/performance/index.js
Expand All @@ -47,8 +43,11 @@ elif [ ! "$COVERAGE" ]; then
--grep="$GREP" \
"$TESTS_PATH"
else
# Ignore TESTS_PATH:
# run all tests when testing for coverage

# --exit required to workaround #8839
./node_modules/.bin/istanbul cover \
./node_modules/.bin/nyc \
--no-default-excludes -x 'tests/**' -x 'node_modules/**' \
./node_modules/mocha/bin/_mocha -- \
--exit \
Expand All @@ -57,9 +56,9 @@ else
--require=./tests/integration/node.setup.js \
--reporter="$REPORTER" \
--grep="$GREP" \
"$TESTS_PATH"

./node_modules/.bin/istanbul check-coverage --line 100
'tests/{unit,integration,mapreduce,component}/test*.js' \
'tests/find/*/test.*.js'
./node_modules/.bin/nyc check-coverage --line 100
fi

EXIT_STATUS=$?
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"build-site": "node ./bin/build-site.js",
"test-coverage": "./bin/test-coverage.sh",
"coverage": "COVERAGE=1 SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find ./bin/test-coverage.sh",
"report-coverage": "npm run test-coverage && istanbul-coveralls --no-rm",
"build-test": "npm run build-test-utils && npm run build-perf",
"build-test-utils": "browserify tests/integration/utils.js > tests/integration/utils-bundle.js",
"build-perf": "browserify tests/performance/index.js > tests/performance-bundle.js",
Expand Down Expand Up @@ -78,15 +77,14 @@
"glob": "7.1.5",
"glob-watcher": "^6.0.0",
"http-server": "0.12.3",
"istanbul": "0.4.5",
"istanbul-coveralls": "1.0.3",
"less": "3.9.0",
"lodash": "4.17.21",
"marky": "1.2.5",
"median": "0.0.2",
"mkdirp": "0.5.1",
"mocha": "10.2.0",
"ncp": "2.0.0",
"nyc": "^15.1.0",
"playwright": "1.42.1",
"pouchdb-express-router": "0.0.11",
"replace": "1.2.1",
Expand Down

0 comments on commit f4bfb5f

Please sign in to comment.