From 2751ea457760ee1eecc525b1d7fa8caa3dbc1c47 Mon Sep 17 00:00:00 2001 From: Alan Gutierrez Date: Sat, 27 Oct 2018 08:32:03 -0500 Subject: [PATCH] Build with tools in `PATH`. --- .travis.yml | 6 +++--- t/cover | 10 +++++----- t/test | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1ce1fe..f57f115 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,6 @@ branches: - master - travis-ci -before_install: - - npm install - - npm install istanbul coveralls +install: + - npm install --no-package-lock --no-save + - npm install -g istanbul coveralls diff --git a/t/cover b/t/cover index 1fd1dc3..35b50b7 100755 --- a/t/cover +++ b/t/cover @@ -2,12 +2,12 @@ set -e -if [ ! -e node_modules/.bin/istanbul ]; then +if ! which istanbul > /dev/null; then cat << EOF 1>&2 Istanbul is required to run coverage. Install Istanbul: - npm install istanbul + npm install -g istanbul EOF exit 1 @@ -16,13 +16,13 @@ fi rm -rf coverage count=1; -for file in $(find . ! -path '*/node_modules/*' -name \*.t.js); do - node_modules/.bin/istanbul cover -x 't/**' -x '*/t/**' $file > /dev/null 2>&1 +for file in $(find t ! -path '*/node_modules/*' -name \*.t.js); do + istanbul cover -x 't/**' -x '*/t/**' $file > /dev/null 2>&1 mv coverage/coverage.json coverage/coverage$count.json count=$(expr $count + 1) done -node_modules/.bin/istanbul report --root coverage --dir coverage > /dev/null +istanbul report --root coverage --dir coverage > /dev/null sed -i -e s,'^SF:'`pwd`/,SF:, coverage/lcov.info diff --git a/t/test b/t/test index 03b866d..d372180 100755 --- a/t/test +++ b/t/test @@ -12,11 +12,11 @@ if [ "$TRAVIS" = "true" ]; then echo "" echo "running with coverage" t/cover - node_modules/.bin/istanbul report --format text + istanbul report --format text echo "" echo "submitting to coveralls.io" - (cat coverage/lcov.info | node_modules/.bin/coveralls) > /dev/null 2>&1 + (cat coverage/lcov.info | coveralls) > /dev/null 2>&1 fi echo ""