From c795cb51af9ad49108b182f8bb214f71556447fb Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Thu, 13 Feb 2025 15:49:05 -0600 Subject: [PATCH] Sort files in findTestFiles After updating the glob package and trying out happo.io@v12.0.0-beta.1, I noticed that there were some diffs that I hadn't expected. After some investigation I noticed that the order of some of the test files in the generated happo-entry.js file changed, which I think may have been triggered by the changes in findTestFiles and the glob package update. I am hoping to stabilize this by sorting the files. --- src/findTestFiles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/findTestFiles.js b/src/findTestFiles.js index c34be22..103a69f 100644 --- a/src/findTestFiles.js +++ b/src/findTestFiles.js @@ -4,5 +4,7 @@ export default async function findTestFiles(pattern) { const files = await glob(pattern, { ignore: ['**/node_modules/**', '**/dist/**', '**/build/**'], }); - return files; + + // Sort the files to make the output deterministic. + return files.sort((a, b) => a.localeCompare(b)); }