MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / workspace

Function workspace

__tests__/security.test.ts:847–855  ·  view source on GitHub ↗
(base: string, children: string[])

Source from the content-addressed store, hash-verified

845 it('neither adopts nor lists the indexed sub-projects of a sensitive folder', async () => {
846 /** A workspace (it has a .git) whose indexes live in its sub-folders. */
847 const workspace = async (base: string, children: string[]): Promise<string> => {
848 fs.mkdirSync(path.join(base, '.git'), { recursive: true });
849 for (const child of children) {
850 fs.mkdirSync(path.join(base, child));
851 fs.writeFileSync(path.join(base, child, 'a.ts'), 'export const a = 1;\n');
852 (await CodeGraph.init(path.join(base, child))).close();
853 }
854 return base;
855 };
856 // Nothing indexed at or above these, so the down-scan below them decides.
857 const one = await workspace(path.join(state.home, '.aws', 'one'), ['only']);
858 const two = await workspace(path.join(state.home, '.aws', 'two'), ['a', 'b']);

Callers 1

security.test.tsFile · 0.70

Calls 3

closeMethod · 0.65
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected