Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add includeDirs to WalkOptions #601

Merged
merged 2 commits into from
Sep 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a test
  • Loading branch information
nayeemrmn committed Sep 18, 2019
commit bf33f3ffb6fb43c0a1d987a4e9bc64d47524563f
14 changes: 14 additions & 0 deletions fs/walk_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ testWalk(
}
);

testWalk(
async (d: string): Promise<void> => {
await touch(d + "/a");
await mkdir(d + "/b");
await touch(d + "/b/c");
},
async function includeDirs(): Promise<void> {
assertReady(2);
const arr = await walkArray(".", { includeDirs: true });
assertEquals(arr.length, 4);
assertEquals(arr, [".", "a", "b", "b/c"]);
}
);

testWalk(
async (d: string): Promise<void> => {
await touch(d + "/x.ts");
Expand Down