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

Function removeWorkspaceFromTestConfig

src/node/services/taskService.test.ts:16688–16704  ·  view source on GitHub ↗
(config: Config, workspaceId: string)

Source from the content-addressed store, hash-verified

16686 }, 20_000);
16687
16688 async function removeWorkspaceFromTestConfig(config: Config, workspaceId: string): Promise<void> {
16689 const cfg = config.loadConfigOrDefault();
16690 let removed = false;
16691
16692 for (const project of cfg.projects.values()) {
16693 const nextWorkspaces = project.workspaces.filter((workspace) => workspace.id !== workspaceId);
16694 if (nextWorkspaces.length === project.workspaces.length) {
16695 continue;
16696 }
16697
16698 project.workspaces = nextWorkspaces;
16699 removed = true;
16700 }
16701
16702 assert(removed, `Expected workspace ${workspaceId} to exist in test config`);
16703 await config.saveConfig(cfg);
16704 }
16705
16706 test("reported leaf cleanup deletes the finished leaf but keeps siblings and parents", async () => {
16707 const config = await createTestConfig(rootDir);

Callers 3

setupReportedTaskChainFunction · 0.85

Calls 3

loadConfigOrDefaultMethod · 0.80
saveConfigMethod · 0.80
assertFunction · 0.50

Tested by

no test coverage detected