Skip to content

Instantly share code, notes, and snippets.

@stringparser
Last active August 29, 2015 14:07
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 stringparser/695420dec0d532cbee7d to your computer and use it in GitHub Desktop.
Save stringparser/695420dec0d532cbee7d to your computer and use it in GitHub Desktop.
bdd minimal tests
#!/bin/sh
# taked from TJ
# https://github.com/visionmedia/commander.js/blob/master/test/run
export NODE_ENV=test
echo
for file in $@; do
printf " \033[90m${file#test/}\033[0m\n --- \n"
node $file 2> /tmp/stderr && echo "\n --- \n \033[36m✔\033[0m all passed"
code=$?
if test $code -ne 0; then
echo "\n --- \n\033[31m ✖ fail!\033[0m"
cat /tmp/stderr >&2
exit $code
fi
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment