Skip to content

Instantly share code, notes, and snippets.

@gunar
Created March 13, 2018 22:20
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 gunar/095de229962184ef2f897293c4b93d94 to your computer and use it in GitHub Desktop.
Save gunar/095de229962184ef2f897293c4b93d94 to your computer and use it in GitHub Desktop.
Help mocha find mocha.opts
m() {
# mocha default path is test/mocha.opts
file=$(readlink -f $1)
[ -f "test/mocha.opts" ] && (mocha $file)
[ -f "../../mocha.opts" ] && (cd ../../../ && mocha $file)
[ -f "../../../mocha.opts" ] && (cd ../../../../ && mocha $file)
[ -f "../../../../mocha.opts" ] && (cd ../../../../../ && mocha $file)
[ -f "../../../../../mocha.opts" ] && (cd ../../../../../../ && mocha $file)
[ -f "../../../../../../mocha.opts" ] && (cd ../../../../../../../ && mocha $file)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment