Created
February 1, 2018 10:57
-
-
Save AshCoolman/5a55f5e5f9c25bd0f1ec3b51a65a15d1 to your computer and use it in GitHub Desktop.
Lerna repo test finder
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
# Easy to use mocha globs to find test files in this structure: | |
# | |
# └─src | |
# │ └─index.spec.js | |
# └─.dist | |
# │ └─index.spec.js | |
# └─node_modules | |
# └─(...various...) | |
# | |
# With this structure, it got very difficult with include+exclude globs (perhaps impossible) | |
# | |
# └─src | |
# │ └─index.spec.js | |
# └─.dist | |
# │ └─index.spec.js | |
# └─node_modules | |
# │ └─(...various...) | |
# └─packages | |
# └─name | |
# └─src | |
# └─.dist | |
# └─node_modules | |
# └─(...various...) | |
# | |
# Thus I just used this shell script to get full control, that will pretty readable (for shell) | |
# | |
# Works with: | |
# - Whatever bash is on Ubuntu 16.04 | |
# - GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17) | |
find . \ | |
\( -name '*.spec.js' -o -name '*.spec.jsx' \) \ | |
-and \ | |
\( \ | |
\( -not -path "*node_modules*" \) \ | |
-and \ | |
\( -not -path "*.dist*" \) \ | |
\) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment