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

Function archiveWorkspaceInTestConfig

src/node/services/taskService.test.ts:16957–16978  ·  view source on GitHub ↗
(
      config: Config,
      workspaceId: string,
      archivedAt = "2026-03-10T00:00:00.000Z"
    )

Source from the content-addressed store, hash-verified

16955 }
16956
16957 async function archiveWorkspaceInTestConfig(
16958 config: Config,
16959 workspaceId: string,
16960 archivedAt = "2026-03-10T00:00:00.000Z"
16961 ): Promise<void> {
16962 let archived = false;
16963 await config.editConfig((cfg) => {
16964 for (const project of cfg.projects.values()) {
16965 const workspace = project.workspaces.find((entry) => entry.id === workspaceId);
16966 if (!workspace) {
16967 continue;
16968 }
16969
16970 workspace.archivedAt = archivedAt;
16971 workspace.unarchivedAt = undefined;
16972 archived = true;
16973 break;
16974 }
16975 return cfg;
16976 });
16977 assert(archived, `Expected workspace ${workspaceId} to exist in test config`);
16978 }
16979
16980 async function setupReportedTaskChain(options?: {
16981 preserveSubagentsUntilArchive?: boolean;

Callers 1

Calls 2

editConfigMethod · 0.80
assertFunction · 0.50

Tested by

no test coverage detected