fix: make DirectoryScanner test order-agnostic for cross-platform compatibility

This commit is contained in:
hannesrudolph 2025-07-02 16:08:31 -06:00
parent 8a21b2a1e7
commit ecec5fe7f8

View file

@ -233,7 +233,8 @@ describe("DirectoryScanner", () => {
await scanner.scanDirectory("/test")
// Verify that only non-hidden files were processed
expect(processedFiles).toEqual(["test/file1.js", "normal/file4.js"])
// Sort the array to ensure consistent order across platforms
expect(processedFiles.sort()).toEqual(["normal/file4.js", "test/file1.js"])
expect(processedFiles).not.toContain("test/.hidden/file2.js")
expect(processedFiles).not.toContain(".git/config")
expect(processedFiles).not.toContain("src/.next/static/file3.js")