MCPcopy Create free account
hub / github.com/vercel/vercel / setupWorkDir

Function setupWorkDir

packages/python/test/cron-detect.test.ts:18–30  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

16 });
17
18 async function setupWorkDir(files: Record<string, string>): Promise<string> {
19 workDir = path.join(
20 tmpdir(),
21 `cron-detect-test-${Date.now()}-${Math.random().toString(36).slice(2)}`
22 );
23 await fs.mkdirp(workDir);
24 for (const [filePath, content] of Object.entries(files)) {
25 const fullPath = path.join(workDir, filePath);
26 await fs.mkdirp(path.dirname(fullPath));
27 await fs.writeFile(fullPath, content);
28 }
29 return workDir;
30 }
31
32 it('detects a single cron entry', async () => {
33 await setupWorkDir({

Callers 1

Calls 2

joinMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected