Skip to content

Instantly share code, notes, and snippets.

@pavlov99
Created August 24, 2018 01:40
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 pavlov99/343d797b80a4fedff9d4228a08067148 to your computer and use it in GitHub Desktop.
Save pavlov99/343d797b80a4fedff9d4228a08067148 to your computer and use it in GitHub Desktop.
Find all *.spec.js testing files in src/ folder and execute with node.js
# This command line executes all test files with NodeJS.
# Test files are located in ./src folder and have *.spec.js
# In order to use ES6 import/export syntax, reify is required: https://github.com/benjamn/reify
# `find` command generates a "test file" which require() every actual test.
# If the output is TAP-compatible, one could pipe it to ./node_modules/.bin/tap-mocha-reporter spec
node --require reify -e "$(find ./src -name '*\.spec\.js' -type f -exec echo "require('{}');" \; | paste -s -d' ' -)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment