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

Function createFixture

src/node/services/memoryHarvest.test.ts:104–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104function createFixture(): Fixture {
105 const tempDir = new TestTempDir("test-memory-harvest");
106 const config = new Config(tempDir.path);
107 const metaService = new MemoryMetaService(tempDir.path);
108 const memoryService = new MemoryService(config, metaService);
109 const ctx: MemoryScopeContext = {
110 runtime: null,
111 checkoutCwd: "",
112 workspaceId: "ws-harvest",
113 projectPath: "/projects/demo",
114 };
115 const summary = createMuxMessage("summary-1", "assistant", "The user prefers concise tests.", {
116 historySequence: 2,
117 compactionBoundary: true,
118 compacted: "user",
119 compactionEpoch: 1,
120 });
121
122 return {
123 memoryService,
124 ctx,
125 metadata: {
126 workspaceId: "ws-harvest",
127 summaryMessageId: "summary-1",
128 summaryHistorySequence: 2,
129 compactionEpoch: 1,
130 compactionRequestMessageId: "compact-request",
131 },
132 messages: [
133 createMuxMessage("m1", "user", "Please remember that I prefer concise tests.", {
134 historySequence: 0,
135 }),
136 ],
137 summary,
138 [Symbol.dispose]() {
139 tempDir[Symbol.dispose]();
140 },
141 };
142}
143
144async function runHarvest(
145 fixture: Fixture,

Callers 1

Calls 1

createMuxMessageFunction · 0.90

Tested by

no test coverage detected