Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. echo 'Your test files...'
  3. files=`git diff origin/staging --name-only | grep spec | grep -v package`
  4. files1=`git diff origin/staging --name-only | grep js | grep -v package | sed 's/\.js/\.spec\.js/g' `
  5. jest ${files} ${files1} --listTests
  6.  
  7. echo '=================================='
  8.  
  9. echo 'NOW RUN JEST WITH COVERAGE:'
  10. appFiles=`git diff origin/staging --name-only | grep js | grep -v "mock-api" | grep -v "stories" | sed 's/spec\.//g'`
  11. appFilesFormatted='["'`echo $appFiles| sed -e 's: :",":g'`'"]'
  12. jest ${files} ${files1} --coverage --collectCoverageFrom=${appFilesFormatted}
  13. error=`echo $?`
  14. if [[ ${error} != "0" ]]; then
  15. RED='\033[0;31m'
  16. printf "${RED}Test fail or code cov not meet"
  17. fi
  18. echo "...done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement