MCPcopy Create free account
hub / github.com/coder/mux / makeWorkspaceMetadata

Function makeWorkspaceMetadata

src/browser/stores/WorkspaceStore.test.ts:183–196  ·  view source on GitHub ↗

Build a FrontendWorkspaceMetadata fixture with sensible test defaults.

(
  workspaceId: string,
  options: Partial<FrontendWorkspaceMetadata> = {}
)

Source from the content-addressed store, hash-verified

181
182/** Build a FrontendWorkspaceMetadata fixture with sensible test defaults. */
183function makeWorkspaceMetadata(
184 workspaceId: string,
185 options: Partial<FrontendWorkspaceMetadata> = {}
186): FrontendWorkspaceMetadata {
187 return {
188 id: workspaceId,
189 name: options.name ?? `test-branch-${workspaceId}`,
190 projectName: options.projectName ?? "test-project",
191 projectPath: options.projectPath ?? "/path/to/project",
192 namedWorkspacePath: options.namedWorkspacePath ?? "/path/to/workspace",
193 createdAt: options.createdAt ?? new Date().toISOString(),
194 runtimeConfig: options.runtimeConfig ?? DEFAULT_RUNTIME_CONFIG,
195 };
196}
197
198const TEST_WORKSPACE_OPTIONS: Partial<FrontendWorkspaceMetadata> = {
199 name: "test-workspace",

Callers 2

createAndAddWorkspaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected