Using windows, I keep running into NPM errors when running scripts. Is pattern matching different between OSX and Win7? Or is this mocha specific?
For example, my tests are in:
src/redux/normalizers/__tests__
and the npm script is:
"test": "mocha --compilers js:babel/register --recursive 'src/**/__tests__/*'"
My console (also in screenshot below) says this:
> mocha --compilers js:babel/register --recursive 'src/**/__tests__/*'
C:\Users\User\WebstormProjects\redux-form\node_modules\mocha\lib\utils.js:626
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) ''src/**/__tests__/*''
screenshot: http://i.imgur.com/EL7LOna.png
Edit I was able to change the repo author's test script for the time being to
"test": "mocha --compilers js:babel/register --recursive src/**/__tests__/*"
Perhaps this is just an error on their part which nobody noticed because nobody else uses windows?
Still, I'd like to understand why. Maybe these links are useful for anyone who comes across this:
Cannot resolve path in Mocha
Two asterisks in file path
You don't need the single quotes. I was able to run the command you provided without them. Like so:
mocha --compilers js:babel/register --recursive src/**/__tests__/*.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With