| 96 | ) |
| 97 | |
| 98 | function waitForProjectIcon(id: ProjectV2.ID, attempts = 50): Effect.Effect<Project.Info, never, Project.Service> { |
| 99 | return Effect.gen(function* () { |
| 100 | const project = yield* Project.Service |
| 101 | const info = yield* project.get(id) |
| 102 | if (info?.icon?.url) return info |
| 103 | if (attempts <= 0) throw new Error(`Project icon was not discovered: ${id}`) |
| 104 | yield* Effect.sleep("10 millis") |
| 105 | return yield* waitForProjectIcon(id, attempts - 1) |
| 106 | }) |
| 107 | } |
| 108 | |
| 109 | describe("Project.fromDirectory", () => { |
| 110 | it.live("should handle git repository with no commits", () => |