-
-
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
CLI path directory expansion should be case-insensitive #3599
Comments
Why? We support case-sensitive filesystems too. You could just name your tests so they would alphabetize in ASCII order. |
It's unexpected behaviour, at least compared to glob. |
When given a directory, Mocha uses If you need a specific order, consider using Maybe it'd be worthwhile to use The function that handles this is in |
We don't set the |
Having looked further, no order is implied via See also: |
@plroebuck Are you suggesting to enable sorting by default (i.e., |
I don't think we should change this behavior, but happy to discuss. Mocha makes no guarantees about the order in which files are loaded if it is not operating on a globspec (this is undocumented). That said... Changing the behavior to sort differently (whatever that looks like) will break tests. And not of the "dirty tests" variety either--users may have some setup hooks within the root suite, which is a perfectly valid use case. Other workarounds such as |
I'm not sure how macOS sorts files, but Finder.app and |
No. Original suggestion was only sorting |
Each |
I updated the API documentation to specify no order should be assumed. |
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.Description
The directory expansion of files should result in a case-insensitively sorted list.
Steps to Reproduce
Run
mocha test/
in a project withtest/a-tests.js
andtest/B-tests.js
.Expected behavior: "a" suite runs before "B" suite
Actual behavior: "B" suite runs before "a" suite
Reproduces how often: always
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 5.2.0node --version
: 10.14.1Additional Information
The text was updated successfully, but these errors were encountered: