Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocha aliased via npm test fails to glob all files #1175

Closed
OliverJAsh opened this issue Mar 28, 2014 · 3 comments
Closed

Mocha aliased via npm test fails to glob all files #1175

OliverJAsh opened this issue Mar 28, 2014 · 3 comments

Comments

@OliverJAsh
Copy link

In the example enclosed, I have this tree:

.
├── package.json
└── test
    ├── foo.js
    └── lib
        └── bar.js

2 directories, 3 files

Setup:

npm install

Run the tests:

./node_modules/.bin/mocha --reporter spec test/**/*.js

Both test/foo.js and test/lib/bar.js are ran. Now run the tests via the same command, but aliased using npm:

npm test

Only test/lib/bar.js is ran. The glob fails to detect test/foo.js, despite it being the same command.

Example: http://cl.ly/0M130n2u1t40

@mrjoelkemp
Copy link
Contributor

Hey @OliverJAsh! The command should be mocha --reporter spec 'test/**/*.js'. Note the wrapping of the blog in quotes. If you don't do that, then it'll get evaluated at the shell level first (which yields the unexpected behavior). The shell globbing that works is mocha --reporter spec test/**.js.

@thalesfsp
Copy link

@mrjoelkemp Where it is mentioned in the Mocha docs?

@mrjoelkemp
Copy link
Contributor

@thalesfsp no idea anymore. This discussion happened ages ago; I'm sure the docs have changed a lot by now :)

Levertion added a commit to Levertion/mcfunction-language-server that referenced this issue Jan 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants