Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo 'Your test files...'
- files=`git diff origin/staging --name-only | grep spec | grep -v package`
- files1=`git diff origin/staging --name-only | grep js | grep -v package | sed 's/\.js/\.spec\.js/g' `
- jest ${files} ${files1} --listTests
- echo '=================================='
- echo 'NOW RUN JEST WITH COVERAGE:'
- appFiles=`git diff origin/staging --name-only | grep js | grep -v "mock-api" | grep -v "stories" | sed 's/spec\.//g'`
- appFilesFormatted='["'`echo $appFiles| sed -e 's: :",":g'`'"]'
- jest ${files} ${files1} --coverage --collectCoverageFrom=${appFilesFormatted}
- error=`echo $?`
- if [[ ${error} != "0" ]]; then
- RED='\033[0;31m'
- printf "${RED}Test fail or code cov not meet"
- fi
- echo "...done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement