Skip to content

Commit

Permalink
test: add more tests for recursive symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Oct 16, 2024
1 parent 6e3233a commit 5d17127
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions __tests__/symlinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,26 @@ for (const type of apiTypes) {
);
});

test(`resolve recursive symlinks (real paths: true, relative paths: true)`, async (t) => {
const api = new fdir()
.withSymlinks()
.withRelativePaths()
.withErrors()
.crawl("./recursive");
const files = await api[type]();
t.expect(files.sort()).toStrictEqual(
normalize([
"..//double/recursive/another-file",
"../just/some/another-file",
"../just/some/another-file2",
"../random/other/another-file",
"../random/other/another-file2",
"dir/some-file",
"random-file",
])
);
});

test(`resolve symlinks (real paths: false)`, async (t) => {
const api = new fdir()
.withSymlinks({ resolvePaths: false })
Expand Down

0 comments on commit 5d17127

Please sign in to comment.