Build a FrontendWorkspaceMetadata fixture with sensible test defaults.
(
workspaceId: string,
options: Partial<FrontendWorkspaceMetadata> = {}
)
| 181 | |
| 182 | /** Build a FrontendWorkspaceMetadata fixture with sensible test defaults. */ |
| 183 | function 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 | |
| 198 | const TEST_WORKSPACE_OPTIONS: Partial<FrontendWorkspaceMetadata> = { |
| 199 | name: "test-workspace", |
no outgoing calls
no test coverage detected