Created
July 25, 2019 20:38
-
-
Save hattmarris/1fbdd786ce003a16e1dc2f4f52b6810e to your computer and use it in GitHub Desktop.
jest coverage in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "jest coverage in a directory" | |
if [ $# -eq 0 ] | |
then | |
echo "No dir supplied" | |
exit | |
fi | |
DIR=$1 | |
MATCH='["'$DIR'/**/*.jsx","!**/*.stories.{js,jsx}"]' | |
MATCH=${MATCH//webpack\//} | |
echo $MATCH | |
jest --collectCoverageFrom=$MATCH --coverage $DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment