( build: TypesGen.WorkspaceBuild, )
| 71 | }; |
| 72 | |
| 73 | const getWorkspaceBuildDurationInSeconds = ( |
| 74 | build: TypesGen.WorkspaceBuild, |
| 75 | ): number | undefined => { |
| 76 | const isCompleted = build.job.started_at && build.job.completed_at; |
| 77 | |
| 78 | if (!isCompleted) { |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | const startedAt = dayjs(build.job.started_at); |
| 83 | const completedAt = dayjs(build.job.completed_at); |
| 84 | return completedAt.diff(startedAt, "seconds"); |
| 85 | }; |
| 86 | |
| 87 | export const displayWorkspaceBuildDuration = ( |
| 88 | build: TypesGen.WorkspaceBuild, |
no test coverage detected