-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix glob pattern support: no comma splitting for 'spec' and 'ignore' options #4315
Conversation
* This is passed as the `coerce` option to `yargs-parser` | ||
* @private | ||
* @ignore | ||
*/ | ||
const globOptions = ['spec', 'ignore']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking, is exclude
option alias'd into ignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but vice versa. ignore
is the canonical and exclude
the alias option name. Yargs-parser applies the coerce function automatically to both names.
So as I understand comma-delimited |
Yes, that's correct. I'm fine with |
Fix looks good, but we only have 1 line of docs on this option and its usage (from what I can see in the |
There is another docs section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one
it's only needed for the configuration files
Yes I could not think where else to put it either. Happy to leave.
To be clear: this removes the ability to specify files such as |
Yes, this is correct for
see also comment. The following has never worked and remains unchanged:
|
Description
Currently we can pass test files via CLI:
node mocha test1 test2
node mocha -- test1 test2
node mocha --spec test1 --spec test2
node mocha --spec test1,test2
via configuration files:
spec: ['test1', 'test2']
spec: ['test1,test2']
The last option (comma-delimited list) is neither documented nor provided in our Yargs configuration. But it does break Mocha's glob pattern support in certain cases, e.g.
{controllers,test}/**/*.test.js
==>['{controllers', 'test}/**/*.test.js']
Description of the Change
For options
spec
andignore
:Applicable issues
closes #4307