MCPcopy Index your code
hub / github.com/freshframework/fresh / readFiles

Function readFiles

packages/update/src/update_test.ts:13–25  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

11import { withTmpDir, writeFiles } from "../../fresh/src/test_utils.ts";
12
13async function readFiles(dir: string): Promise<Record<string, string>> {
14 const files: Record<string, string> = {};
15
16 for await (
17 const entry of walk(dir, { includeDirs: false, includeFiles: true })
18 ) {
19 const pathname = path.relative(dir, entry.path);
20 const content = await Deno.readTextFile(entry.path);
21 files[`/${pathname.replaceAll(/[\\]+/g, "/")}`] = content.trim();
22 }
23
24 return files;
25}
26
27Deno.test("update - remove JSX pragma import", async () => {
28 await using _tmp = await withTmpDir();

Callers 1

update_test.tsFile · 0.85

Calls 2

walkFunction · 0.85
readTextFileMethod · 0.80

Tested by

no test coverage detected