MCPcopy Index your code
hub / github.com/coder/mux / createFixture

Function createFixture

src/node/services/tools/memory.test.ts:44–70  ·  view source on GitHub ↗
(options?: {
  memoryAccess?: MemoryScopeAccess;
})

Source from the content-addressed store, hash-verified

42}
43
44async function createFixture(options?: {
45 memoryAccess?: MemoryScopeAccess;
46}): Promise<MemoryToolFixture> {
47 const tempDir = new TestTempDir("test-memory-tool");
48 const muxHome = path.join(tempDir.path, "mux-home");
49 const checkout = path.join(tempDir.path, "checkout");
50 await fsPromises.mkdir(muxHome, { recursive: true });
51 await fsPromises.mkdir(checkout, { recursive: true });
52 const config = createTestToolConfig(checkout, { workspaceId: "ws-tool" });
53 config.workspaceProjectPath = FIXTURE_PROJECT_PATH;
54 config.runtime = new LocalRuntime(checkout);
55 config.memoryService = new MemoryService(new Config(muxHome), new MemoryMetaService(muxHome));
56 config.memoryAccess = options?.memoryAccess ?? {
57 global: "readwrite",
58 project: "readwrite",
59 workspace: "readwrite",
60 };
61 return {
62 muxHome,
63 checkout,
64 config,
65 tool: createMemoryTool(config),
66 [Symbol.dispose]() {
67 tempDir[Symbol.dispose]();
68 },
69 };
70}
71
72describe("memory tool sub-project workspaces", () => {
73 it("resolves project memory from the project identity, not the execution cwd", async () => {

Callers 1

memory.test.tsFile · 0.70

Calls 2

createTestToolConfigFunction · 0.90
createMemoryToolFunction · 0.90

Tested by

no test coverage detected