Skip to content

Instantly share code, notes, and snippets.

@bcaudan
Last active January 2, 2016 07:09
Show Gist options
  • Save bcaudan/8268052 to your computer and use it in GitHub Desktop.
Save bcaudan/8268052 to your computer and use it in GitHub Desktop.
Check test files for "ddescribe", "iit" or "pause()". Usage: check-js-test src/test/javascript/unit src/test/javascript/e2e
#!/bin/bash
function hasAny() {
sep="\|"
regex="$( printf "${sep}%s" "$@" )"
regex="${regex:${#sep}}"
grep -nri --color=always "$regex" *
}
SEARCH="hasAny 'ddescribe' 'iit' 'pause()'"
EXIT_STATUS=0
for TEST_PATH in "$@"
do
cd "$TEST_PATH"
echo "$SEARCH in '$TEST_PATH'"
eval "$SEARCH"
HAS_RESULT=!$?
(( EXIT_STATUS=$EXIT_STATUS || $HAS_RESULT ))
cd -
done
exit $EXIT_STATUS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment