MCPcopy Create free account
hub / github.com/denoland/std / assertWalkSyncPaths

Function assertWalkSyncPaths

fs/walk_test.ts:28–40  ·  view source on GitHub ↗
(
  parentDir: string,
  rootPath: string,
  expectedPaths: string[],
  options?: WalkOptions,
)

Source from the content-addressed store, hash-verified

26}
27
28function 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
42Deno.test("walk() returns current dir for empty dir", async () => {
43 const tempDirPath = await Deno.makeTempDir({

Callers 2

walk_test.tsFile · 0.85
fnFunction · 0.85

Calls 5

resolveFunction · 0.90
walkSyncFunction · 0.90
assertEqualsFunction · 0.90
assertArrayIncludesFunction · 0.90
fromMethod · 0.45

Tested by

no test coverage detected