Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues committed Nov 27, 2024
1 parent 9862732 commit 537a59b
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,30 @@ describe("readDirRecursive", () => {

const result = await readDirRecursive("/root")

const paths = result.map((r) => r.path)

expect(paths).toEqual([
"/root",
"/root",
"/root/subdir",
"/root/subdir",
"/root/subdir/nested",
])

expect(result).toEqual([
{ name: "file1.txt", isDirectory: expect.any(Function), path: "/root" },
{ name: "subdir", isDirectory: expect.any(Function), path: "/root" },
{ name: "file1.txt", isDirectory: expect.any(Function) },
{ name: "subdir", isDirectory: expect.any(Function) },
{
name: "file2.txt",
isDirectory: expect.any(Function),
path: "/root/subdir",
},
{
name: "nested",
isDirectory: expect.any(Function),
path: "/root/subdir",
},
{
name: "file3.txt",
isDirectory: expect.any(Function),
path: "/root/subdir/nested",
},
])

Expand Down

0 comments on commit 537a59b

Please sign in to comment.