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

Function prepareFixtureFilesystem

packages/node/test/unit/test-utils.ts:44–63  ·  view source on GitHub ↗
(
  fixtureName: string,
  folderPrefix = 'vercel-node-fixtures'
)

Source from the content-addressed store, hash-verified

42}
43
44export async function prepareFixtureFilesystem(
45 fixtureName: string,
46 folderPrefix = 'vercel-node-fixtures'
47): Promise<Filesystem> {
48 const fixtureDir = join(__dirname, '../unit-fixtures', fixtureName);
49 const fixtureFiles: Fs = {};
50 const paths = await glob('**/*', {
51 cwd: fixtureDir,
52 nodir: true,
53 dot: true,
54 });
55
56 for (const relativePath of paths) {
57 fixtureFiles[relativePath] = await fs.readFile(
58 join(fixtureDir, relativePath)
59 );
60 }
61
62 return prepareFilesystem(fixtureFiles, folderPrefix);
63}

Callers 1

Calls 2

globFunction · 0.90
prepareFilesystemFunction · 0.85

Tested by

no test coverage detected