Skip to content

Commit

Permalink
chore: add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Dec 21, 2024
1 parent 5412e3a commit c19f4f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __tests__/symlinks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ for (const type of apiTypes) {
t.expect(files.sort()).toStrictEqual(normalize(["/other/dir/file-2"]));
});

test("resolve symlinks (exclude /some/dir/, real paths: false)", async (t) => {
const api = new fdir()
.withSymlinks({ resolvePaths: false })
.exclude((_name, path) => path === resolveSymlinkRoot("/some/dir/dirSymlink/"))
.crawl("/some/dir")
const files = await api[type]();
t.expect(files.sort()).toStrictEqual(normalize(["/some/dir/fileSymlink"]));
});

test(`do not resolve symlinks`, async (t) => {
const api = new fdir().crawl("/some/dir");
const files = await api[type]();
Expand Down

0 comments on commit c19f4f4

Please sign in to comment.