fix test coverage

This commit is contained in:
Sebastian McKenzie 2015-07-16 15:46:31 +01:00
parent e1c981a9de
commit c76536be90
6 changed files with 26 additions and 15 deletions

View File

@ -1,2 +1,3 @@
instrumentation: instrumentation:
root: lib root: .
excludes: "**/node_modules/**"

View File

@ -36,7 +36,7 @@ test-browser:
test-cov: clean test-cov: clean
BABEL_ENV=test; \ BABEL_ENV=test; \
make build make build
node $(ISTANBUL_CMD) $(MOCHA_CMD) -- test/core ./scripts/test-cov.sh
test-travis: bootstrap lint build test test-travis: bootstrap lint build test

1
mocha.opts Normal file
View File

@ -0,0 +1 @@
--reporter dot --ui tdd

View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e
TEST_DIRS=""
for f in packages/*; do
if [ -n "$TEST_ONLY" ] && [ `basename $f` != "$TEST_ONLY" ]; then
continue
fi
if [ -d "$f/test" ]; then
TEST_DIRS="$f/test $TEST_DIRS"
fi
done
echo $TEST_DIRS

5
scripts/test-cov.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -e
node node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- `scripts/_get-test-directories.sh` --opts mocha.opts
test -n "`which open`" && open coverage/lcov-report/index.html

View File

@ -5,16 +5,4 @@ if [ -z "$TEST_GREP" ]; then
TEST_GREP="" TEST_GREP=""
fi fi
TEST_DIRS="" node node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts mocha.opts --grep "$TEST_GREP"
for f in packages/*; do
if [ -n "$TEST_ONLY" ] && [ `basename $f` != "$TEST_ONLY" ]; then
continue
fi
if [ -d "$f/test" ]; then
TEST_DIRS="$f/test $TEST_DIRS"
fi
done
node node_modules/mocha/bin/_mocha $TEST_DIRS --reporter dot --ui tdd --grep "$TEST_GREP"