Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/cli/lookup-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ module.exports = function lookupFiles(
debug('looking for files using glob pattern: %s', pattern);
}
files.push(
...glob.sync(pattern, {
nodir: true,
windowsPathsNoEscape: true
})
...glob
.sync(pattern, {
nodir: true,
windowsPathsNoEscape: true
})
// glob@8 and earlier sorted results in en; glob@9 depends on OS sorting.
// This preserves the older glob behavior.
// https://github.com/mochajs/mocha/pull/5250
.sort((a, b) => a.localeCompare(b, 'en'))
Copy link
Member Author

@JoshuaKGoldberg JoshuaKGoldberg Nov 13, 2024

Choose a reason for hiding this comment

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

This was "fun" to debug. The order of tests is different with the newer version of glob.

From npx mocha "test/integration/fixtures/options/parallel/test-*":

  • main: a, b, c, d
  • glob-10: d, c, b, a

This is isaacs/node-glob#576: that it's determined by OS latency. glob@8 used to sort (https://github.com/isaacs/node-glob/blob/v8.1.0/common.js#L20).

);
if (!files.length) {
throw createNoFilesMatchPatternError(
Expand Down
Loading
Loading