MCPcopy
hub / github.com/coder/mux / createTestHistoryService

Function createTestHistoryService

src/node/services/testHistoryService.ts:17–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15import * as path from "path";
16
17export async function createTestHistoryService(): Promise<{
18 historyService: HistoryService;
19 config: Config;
20 tempDir: string;
21 cleanup: () => Promise<void>;
22}> {
23 const tempDir = path.join(
24 os.tmpdir(),
25 `mux-test-history-${Date.now()}-${Math.random().toString(36).slice(2)}`
26 );
27 await fs.mkdir(tempDir, { recursive: true });
28 const config = new Config(tempDir);
29 const historyService = new HistoryService(config);
30 return {
31 historyService,
32 config,
33 tempDir,
34 cleanup: () => fs.rm(tempDir, { recursive: true, force: true }),
35 };
36}

Calls

no outgoing calls

Tested by 7

createServicesFunction · 0.72
makeServiceFunction · 0.72
makeServiceWithConfigFunction · 0.72
createSessionHarnessFunction · 0.72
createSessionHarnessFunction · 0.72
createSessionHarnessFunction · 0.72
createSessionFunction · 0.72