MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / withTempFile

Function withTempFile

src/core/parser-vscode-files.test.ts:31–36  ·  view source on GitHub ↗
(name: string, content: string, run: (filePath: string) => void)

Source from the content-addressed store, hash-verified

29}
30
31function withTempFile(name: string, content: string, run: (filePath: string) => void): void {
32 const dir = makeTempDir();
33 const filePath = path.join(dir, name);
34 fs.writeFileSync(filePath, content, 'utf-8');
35 run(filePath);
36}
37
38/** Write a temp file and return its path (for async tests that can't use the callback form). */
39function makeTempFile(name: string, content: string): string {

Callers 1

Calls 2

runFunction · 0.85
makeTempDirFunction · 0.70

Tested by

no test coverage detected