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

Function assertWalkPaths

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

Source from the content-addressed store, hash-verified

12const testdataDir = resolve(fromFileUrl(import.meta.url), "../testdata/walk");
13
14async function assertWalkPaths(
15 parentDir: string,
16 rootPath: string,
17 expectedPaths: string[],
18 options?: WalkOptions,
19) {
20 const root = resolve(parentDir, rootPath);
21 const entries = await Array.fromAsync(walk(root, options));
22
23 const expected = expectedPaths.map((path) => resolve(root, path));
24 assertEquals(entries.length, expected.length);
25 assertArrayIncludes(entries.map(({ path }) => path), expected);
26}
27
28function assertWalkSyncPaths(
29 parentDir: string,

Callers 2

walk_test.tsFile · 0.85
fnFunction · 0.85

Calls 4

resolveFunction · 0.90
walkFunction · 0.90
assertEqualsFunction · 0.90
assertArrayIncludesFunction · 0.90

Tested by

no test coverage detected