( parentDir: string, rootPath: string, expectedPaths: string[], options?: WalkOptions, )
| 26 | } |
| 27 | |
| 28 | function assertWalkSyncPaths( |
| 29 | parentDir: string, |
| 30 | rootPath: string, |
| 31 | expectedPaths: string[], |
| 32 | options?: WalkOptions, |
| 33 | ) { |
| 34 | const root = resolve(parentDir, rootPath); |
| 35 | const entriesSync = Array.from(walkSync(root, options)); |
| 36 | |
| 37 | const expected = expectedPaths.map((path) => resolve(root, path)); |
| 38 | assertEquals(entriesSync.length, expected.length); |
| 39 | assertArrayIncludes(entriesSync.map(({ path }) => path), expected); |
| 40 | } |
| 41 | |
| 42 | Deno.test("walk() returns current dir for empty dir", async () => { |
| 43 | const tempDirPath = await Deno.makeTempDir({ |
no test coverage detected