Why does Mocha not allow this path (or pattern)?

Using windows, I constantly encounter NPM errors when running scripts. Pattern matching between OSX and Win7? Or is it a mocha specific?

For example, my tests:

src/redux/normalizers/__tests__ 

and npm script:

 "test": "mocha --compilers js:babel/register --recursive 'src/**/__tests__/*'" 

My console (also in the screenshot below) says the following:

 > 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 author test repo script so far

 "test": "mocha --compilers js:babel/register --recursive src/**/__tests__/*" 

Perhaps this is only a mistake on their part that no one has noticed, because no one is using windows?

However, I would like to understand why. Perhaps these links are useful to anyone who comes across this:

+6
source share
1 answer

You do not need single quotes. I was able to execute the command that you provided without them. For instance:

 mocha --compilers js:babel/register --recursive src/**/__tests__/*.js 
+2
source

All Articles