MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / withTempConfig

Function withTempConfig

tests/server-config.test.ts:8–17  ·  view source on GitHub ↗
(content: string, fn: (filePath: string) => Promise<void>)

Source from the content-addressed store, hash-verified

6
7// Helper: write a temp config file and set CODEBASE_CONTEXT_CONFIG_PATH
8async function withTempConfig(content: string, fn: (filePath: string) => Promise<void>) {
9 const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'ccc-config-test-'));
10 const filePath = path.join(tmpDir, 'config.json');
11 await fs.writeFile(filePath, content, 'utf8');
12 try {
13 await fn(filePath);
14 } finally {
15 await fs.rm(tmpDir, { recursive: true, force: true });
16 }
17}
18
19describe('loadServerConfig', () => {
20 afterEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected