Skip to content

Instantly share code, notes, and snippets.

@nwinkler
Created December 11, 2014 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwinkler/f6c2f278f3a92ed3ba4f to your computer and use it in GitHub Desktop.
Save nwinkler/f6c2f278f3a92ed3ba4f to your computer and use it in GitHub Desktop.
Find Jasmine test cases that contain `ddescribe` or `iit` and print a message to stderr
#!/bin/bash
# This script can be used to verify that there aren't any test cases containing ddescribe or iit.
#
# Steps:
# Finds the following files: *Spec.js, *.spec
# Checks whether the files contain one of the patterns "ddescribe" or "iit"
# If one of the patterns is found, exits with code 1
find . -name *Spec.js -o -name *.spec | xargs grep -e "ddescribe" -e "iit" >&2
if [ "$?" -eq "0" ]
then
echo "Testcases found with ddescribe or iit" >&2
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment