fix(test): use path.join for cross-platform glob test assertions (#14837)

pull/14883/head
Luke Parker 2026-02-24 20:07:56 +10:00 committed by GitHub
parent a592bd9684
commit de796d9a00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ describe("Glob", () => {
const results = await Glob.scan("**/*.txt", { cwd: tmp.path })
expect(results).toEqual(["nested/deep.txt"])
expect(results).toEqual([path.join("nested", "deep.txt")])
})
test("returns empty array for no matches", async () => {
@ -82,7 +82,7 @@ describe("Glob", () => {
const results = await Glob.scan("**/*.txt", { cwd: tmp.path })
expect(results).toEqual(["realdir/file.txt"])
expect(results).toEqual([path.join("realdir", "file.txt")])
})
test("follows symlinks when symlink option is true", async () => {
@ -93,7 +93,7 @@ describe("Glob", () => {
const results = await Glob.scan("**/*.txt", { cwd: tmp.path, symlink: true })
expect(results.sort()).toEqual(["linkdir/file.txt", "realdir/file.txt"])
expect(results.sort()).toEqual([path.join("linkdir", "file.txt"), path.join("realdir", "file.txt")])
})
test("includes dotfiles when dot option is true", async () => {