Skip to content

Commit

Permalink
Build with tools in PATH.
Browse files Browse the repository at this point in the history
  • Loading branch information
flatheadmill committed Oct 27, 2018
1 parent 91753b0 commit 2751ea4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions t/cover
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions t/test
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

0 comments on commit 2751ea4

Please sign in to comment.