- Treat empty `gh pr list` output as no results - Fall back to `main` when provider default-branch detection fails - Add coverage for PR creation fallback behavior
Showing the changes to apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts (1 of 4 files). Show all
Unified · Split
| @@ -106,6 +106,23 @@ it.effect("uses gh json listing for non-open change request state queries", () = · 105 unmodified lines | |||
| 106 | }), | 106 | }), |
| 107 | ); | 107 | ); |
| 108 | 108 | ||
| 109 | it.effect("treats empty non-open change request listing output as no results", () => | ||
| 110 | Effect.gen(function* () { | ||
| 111 | const provider = yield* makeProvider({ | ||
| 112 | execute: () => Effect.succeed(processResult("")), | ||
| 113 | }); | ||
| 114 | |||
| 115 | const changeRequests = yield* provider.listChangeRequests({ | ||
| 116 | cwd: "/repo", | ||
| 117 | headSelector: "feature/empty", | ||
| 118 | state: "all", | ||
| 119 | limit: 10, | ||
| 120 | }); | ||
| 121 | |||
| 122 | assert.deepStrictEqual(changeRequests, []); | ||
| 123 | }), | ||
| 124 | ); | ||
| 125 | |||
| 109 | it.effect("creates GitHub PRs through provider-neutral input names", () => | 126 | it.effect("creates GitHub PRs through provider-neutral input names", () => |
| 110 | Effect.gen(function* () { | 127 | Effect.gen(function* () { |
| 111 | let createInput: Parameters<GitHubCliShape["createPullRequest"]>[0] | null = null; | 128 | let createInput: Parameters<GitHubCliShape["createPullRequest"]>[0] | null = null; |