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

feat: bumped glob dependency from 8 to 10 #5250

Merged
merged 6 commits into from
Nov 23, 2024
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