Skip to content

Commit

Permalink
Refactor: Replaced istanbul with nyc
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Jun 10, 2019
1 parent 0bcf073 commit 330083e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib-cov
coverage
.grunt
.lock-wscript
.nyc_output

# Compile
build/Release
Expand Down
22 changes: 20 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,25 @@
"codacy-coverage": "^3.4.0",
"coveralls": "^3.0.4",
"eslint": "^5.15.2",
"istanbul": "^0.4.5"
"nyc": "^14.1.1"
},
"nyc": {
"check-coverage": true,
"branches": 85,
"lines": 85,
"functions": 85,
"statements": 85,
"all": true,
"exclude": [
"**/example.js",
"**/coverage/**",
"**/packages/**",
"**/.git/**"
],
"reporter": [
"lcov",
"text"
]
},
"engines": {
"node": ">=8.0.0"
Expand All @@ -39,8 +57,8 @@
"coverage",
"coveralls",
"eslint",
"istanbul",
"lint",
"nyc",
"test",
"unittest"
],
Expand Down
8 changes: 4 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ result=0
libpath="$(pwd)"
nodebin="$libpath/node_modules/.bin"
eslintBin="$nodebin/eslint"
istanbulBin="$nodebin/istanbul"
nycBin="$nodebin/nyc"
coverallsBin="$nodebin/coveralls"
codacyBin="$nodebin/codacy-coverage"

Expand Down Expand Up @@ -58,11 +58,11 @@ else
fi

# Run test script with coverage
if [[ -x "$istanbulBin" ]]; then
"$istanbulBin" cover test.js || result=1
if [[ -x "$nycBin" ]]; then
"$nycBin" --clean node test.js || result=1
else
result=1
echo -e "\033[31mERROR:\033[0m Istanbul is not installed"
echo -e "\033[31mERROR:\033[0m nyc is not installed"
echo "Run 'npm i' to install all dependencies."
echo
fi
Expand Down

0 comments on commit 330083e

Please sign in to comment.