Created
February 2, 2012 04:58
-
-
Save timoxley/1721593 to your computer and use it in GitHub Desktop.
Recursively run all tests in test directory using mocha
This file contains 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
// this will find all files ending with _test.js and run them with Mocha. Put this in your package.json | |
"scripts": { | |
"test": "find ./tests -name '*_test.js' | xargs mocha -R spec" | |
}, | |
it works for me to wrap glob path into quotes
"scripts": { "test": "mocha \"test/**/*.spec.js\"" }
👍
it works for me to wrap glob path into quotes
"scripts": { "test": "mocha \"test/**/*.spec.js\"" }🖖
OMG, Thank you!
Without escaped quotes, it behaves totally different, and I thought that I have issues with NYC. I could not generate a proper code coverage report, and it derived me nearly insane.
for me its working using --recursive
"scripts": {
"test": "mocha --recursive --exit"
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alitarlaaci1981 you can connect me in this regard, I use mocha with JS.
[email protected]