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

update docs for the glob #3217

Merged
merged 1 commit into from Jan 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.md
Expand Up @@ -1272,7 +1272,7 @@ $ mocha --reporter list --growl

## The `test/` Directory

By default, `mocha` looks for the glob `./test/*.js` and `./test/*.coffee`, so you may want to put your tests in `test/` folder.
By default, `mocha` looks for the glob `./test/*.js`, so you may want to put your tests in `test/` folder. If you want to include sub directories, use `--recursive`, because of `./test/*.js` is only matched with files which in the first depth of `test` directory and `./test/**/*.js` is only matched with files which in the second depth of `test` directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./test/**/*.jsis only matched with files which in the second depth oftest` directory

Is this true? I though '/**/' matches zero or more directory levels.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://www.npmjs.com/package/glob

** If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on if you pass a glob pattern as a string or use shell expansion. Shell expansion will only expand to the second level, and actually exactly the second level, not the first one, so that is also a bit confusing to many


## Editor Plugins

Expand Down