mochajs / mocha

☕️ simple, flexible, fun javascript test framework for node.js & the browser
https://mochajs.org
MIT License
22.6k stars 3.01k forks source link

Documentation around glob patterns and shell expansion #3136

Closed boneskull closed 6 years ago

boneskull commented 6 years ago

From @boneskull on July 12, 2015 4:15

from mochajs/mocha#1115

Not sure if it is needed, but it may be worth noting that due to shell expansion, glob patterns should be wrapped in double quotes on unix shells.

mocha -w -r should "test/**/*.js"

Using that would render the --recursive flag useless.

Copied from original issue: mochajs/old-mochajs-site#8

UPDATE Double quotes for portability--don't want to say single quotes in one place and double quotes in the other, so DOUBLE QUOTES (single quotes fine on *nix if you don't want variable expansion to happen, but let's assume there are no variables in use)

akrawchyk commented 6 years ago

A good example of documentation for this is in the NON-BUGS section of the find man page.

I'm thinking the documentation for this should be in usage examples which is one of the options proposed by @mrjoelkemp in the original issue https://github.com/mochajs/mocha/issues/1115. This is because I can't find any examples in man pages or otherwise where the command invocation for globs is documented (since this is related to the behavior of shells, not mocha or otherwise).

So, for starters should I beef up the "Getting Started" CLI example? https://github.com/mochajs/mocha/blob/master/docs/index.md#getting-started

ematipico commented 6 years ago

Is this issue still valid? I could offer some help

akrawchyk commented 6 years ago

@ematipicoI think this will be easy to fix once there is a clear solution. What do you think of my proposal above?

boneskull commented 6 years ago

@ematipico @akrawchyk I welcome any PR addressing this, we can discuss. see updated description though

akrawchyk commented 6 years ago

@boneskull PR opened, I'm waffling on the language for this but I took a first stab just to get the ball rolling.