From fd44fe34d43f0522cfd069d7f13f7326d02d89bd Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 18 Sep 2019 16:37:37 +0100 Subject: Add includeDirs to WalkOptions (denoland/deno_std#601) Original: https://github.com/denoland/deno_std/commit/de8d0ab4a100707b57f12cff5db635356221f324 --- fs/walk_test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'fs/walk_test.ts') diff --git a/fs/walk_test.ts b/fs/walk_test.ts index 1111f9f00..034e327e2 100644 --- a/fs/walk_test.ts +++ b/fs/walk_test.ts @@ -118,6 +118,20 @@ testWalk( } ); +testWalk( + async (d: string): Promise => { + await touch(d + "/a"); + await mkdir(d + "/b"); + await touch(d + "/b/c"); + }, + async function includeDirs(): Promise { + assertReady(2); + const arr = await walkArray(".", { includeDirs: true }); + assertEquals(arr.length, 4); + assertEquals(arr, [".", "a", "b", "b/c"]); + } +); + testWalk( async (d: string): Promise => { await touch(d + "/x.ts"); -- cgit v1.2.3