Open History to see the last commit
1import fs from "node:fs";
2import path from "node:path";
3
4import * as NodeServices from "@effect/platform-node/NodeServices";
5import { it } from "@effect/vitest";
6import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
7import { expect } from "vitest";
8
9import { GitCommandError, GitHubCliError, TextGenerationError } from "../Errors.ts";
10import { type GitManagerShape } from "../Services/GitManager.ts";
11import {
12 type GitHubCliShape,
13 type GitHubPullRequestSummary,
14 GitHubCli,
15} from "../Services/GitHubCli.ts";
16import { type TextGenerationShape, TextGeneration } from "../Services/TextGeneration.ts";
17import { GitServiceLive } from "./GitService.ts";
18import { GitService } from "../Services/GitService.ts";
19import { GitCoreLive } from "./GitCore.ts";
20import { makeGitManager } from "./GitManager.ts";
21
22interface FakeGhScenario {
23 prListSequence?: string[];
24 createdPrUrl?: string;
25 defaultBranch?: string;
26 failWith?: GitHubCliError;
27}
28
29interface FakeGitTextGeneration {
30 generateCommitMessage: (input: {
31 cwd: string;
32 branch: string | null;
33 stagedSummary: string;
34 stagedPatch: string;
35 }) => Effect.Effect<{ subject: string; body: string }, TextGenerationError>;
36 generatePrContent: (input: {
37 cwd: string;
38 baseBranch: string;
39 headBranch: string;
40 commitSummary: string;
41 diffSummary: string;
42 diffPatch: string;
43 }) => Effect.Effect<{ title: string; body: string }, TextGenerationError>;
44}
45
46function makeTempDir(
47 prefix: string,
48): Effect.Effect<string, PlatformError.PlatformError, FileSystem.FileSystem | Scope.Scope> {
49 return Effect.gen(function* () {
50 const fileSystem = yield* FileSystem.FileSystem;
51 return yield* fileSystem.makeTempDirectoryScoped({ prefix });
52 });
53}
54
55function runGit(
56 cwd: string,
57 args: readonly string[],
58 allowNonZeroExit = false,
59): Effect.Effect<
60 { readonly code: number; readonly stdout: string; readonly stderr: string },
61 GitCommandError,
62 GitService
63> {
64 return Effect.gen(function* () {
65 const gitService = yield* GitService;
66 return yield* gitService.execute({
67 operation: "GitManager.test.runGit",
68 cwd,
69 args,
70 allowNonZeroExit,
71 });
72 });
73}
74
75function initRepo(
76 cwd: string,
77): Effect.Effect<void, PlatformError.PlatformError | GitCommandError, FileSystem.FileSystem | Scope.Scope | GitService> {
78 return Effect.gen(function* () {
79 const fs = yield* FileSystem.FileSystem;
80 yield* runGit(cwd, ["init", "--initial-branch=main"]);
81 yield* runGit(cwd, ["config", "user.email", "test@example.com"]);
82 yield* runGit(cwd, ["config", "user.name", "Test User"]);
83 yield* fs.writeFileString(path.join(cwd, "README.md"), "hello\n");
84 yield* runGit(cwd, ["add", "README.md"]);
85 yield* runGit(cwd, ["commit", "-m", "Initial commit"]);
86 });
87}
88
89function createBareRemote(): Effect.Effect<
90 string,
91 PlatformError.PlatformError | GitCommandError,
92 FileSystem.FileSystem | Scope.Scope | GitService
93> {
94 return Effect.gen(function* () {
95 const remoteDir = yield* makeTempDir("t3code-git-remote-");
96 yield* runGit(remoteDir, ["init", "--bare"]);
97 return remoteDir;
98 });
99}
100
101function createTextGeneration(overrides: Partial<FakeGitTextGeneration> = {}): TextGenerationShape {
102 const implementation: FakeGitTextGeneration = {
103 generateCommitMessage: () =>
104 Effect.succeed({
105 subject: "Implement stacked git actions",
106 body: "",
107 }),
108 generatePrContent: () =>
109 Effect.succeed({
110 title: "Add stacked git actions",
111 body: "## Summary\n- Add stacked git workflow\n\n## Testing\n- Not run",
112 }),
113 ...overrides,
114 };
115
116 return {
117 generateCommitMessage: (input) =>
118 implementation.generateCommitMessage(input).pipe(
119 Effect.mapError(
120 (cause) =>
121 new TextGenerationError({
122 operation: "generateCommitMessage",
123 detail: "fake text generation failed",
124 ...(cause !== undefined ? { cause } : {}),
125 }),
126 ),
127 ),
128 generatePrContent: (input) =>
129 implementation.generatePrContent(input).pipe(
130 Effect.mapError(
131 (cause) =>
132 new TextGenerationError({
133 operation: "generatePrContent",
134 detail: "fake text generation failed",
135 ...(cause !== undefined ? { cause } : {}),
136 }),
137 ),
138 ),
139 };
140}
141
142function createGitHubCliWithFakeGh(scenario: FakeGhScenario = {}): {
143 service: GitHubCliShape;
144 ghCalls: string[];
145} {
146 const prListQueue = [...(scenario.prListSequence ?? [])];
147 const ghCalls: string[] = [];
148
149 const execute: GitHubCliShape["execute"] = (input) => {
150 const args = [...input.args];
151 ghCalls.push(args.join(" "));
152
153 if (scenario.failWith) {
154 return Effect.fail(scenario.failWith);
155 }
156
157 if (args[0] === "pr" && args[1] === "list") {
158 const stdout = (prListQueue.shift() ?? "[]") + "\n";
159 return Effect.succeed({
160 stdout,
161 stderr: "",
162 code: 0,
163 signal: null,
164 timedOut: false,
165 });
166 }
167
168 if (args[0] === "pr" && args[1] === "create") {
169 return Effect.succeed({
170 stdout:
171 (scenario.createdPrUrl ?? "https://github.com/pingdotgg/codething-mvp/pull/101") + "\n",
172 stderr: "",
173 code: 0,
174 signal: null,
175 timedOut: false,
176 });
177 }
178
179 if (args[0] === "pr" && args[1] === "view") {
180 return Effect.succeed({
181 stdout: "",
182 stderr: "",
183 code: 0,
184 signal: null,
185 timedOut: false,
186 });
187 }
188
189 if (args[0] === "repo" && args[1] === "view") {
190 return Effect.succeed({
191 stdout: `${scenario.defaultBranch ?? "main"}\n`,
192 stderr: "",
193 code: 0,
194 signal: null,
195 timedOut: false,
196 });
197 }
198
199 return Effect.fail(
200 new GitHubCliError({
201 operation: "execute",
202 detail: `Unexpected gh command: ${args.join(" ")}`,
203 }),
204 );
205 };
206
207 return {
208 service: {
209 execute,
210 listOpenPullRequests: (input) =>
211 execute({
212 cwd: input.cwd,
213 args: [
214 "pr",
215 "list",
216 "--head",
217 input.headBranch,
218 "--state",
219 "open",
220 "--limit",
221 String(input.limit ?? 1),
222 "--json",
223 "number,title,url,baseRefName,headRefName",
224 ],
225 }).pipe(
226 Effect.map(
227 (result) => JSON.parse(result.stdout) as ReadonlyArray<GitHubPullRequestSummary>,
228 ),
229 ),
230 createPullRequest: (input) =>
231 execute({
232 cwd: input.cwd,
233 args: [
234 "pr",
235 "create",
236 "--base",
237 input.baseBranch,
238 "--head",
239 input.headBranch,
240 "--title",
241 input.title,
242 "--body-file",
243 input.bodyFile,
244 ],
245 }).pipe(Effect.asVoid),
246 getDefaultBranch: (input) =>
247 execute({
248 cwd: input.cwd,
249 args: ["repo", "view", "--json", "defaultBranchRef", "--jq", ".defaultBranchRef.name"],
250 }).pipe(
251 Effect.map((result) => {
252 const value = result.stdout.trim();
253 return value.length > 0 ? value : null;
254 }),
255 ),
256 },
257 ghCalls,
258 };
259}
260
261function runStackedAction(
262 manager: GitManagerShape,
263 input: {
264 cwd: string;
265 action: "commit" | "commit_push" | "commit_push_pr";
266 commitMessage?: string;
267 },
268) {
269 return manager.runStackedAction(input);
270}
271
272function makeManager(input?: {
273 ghScenario?: FakeGhScenario;
274 textGeneration?: Partial<FakeGitTextGeneration>;
275}) {
276 const { service: gitHubCli, ghCalls } = createGitHubCliWithFakeGh(input?.ghScenario);
277 const textGeneration = createTextGeneration(input?.textGeneration);
278
279 const gitCoreLayer = GitCoreLive.pipe(
280 Layer.provideMerge(GitServiceLive),
281 Layer.provideMerge(NodeServices.layer),
282 );
283
284 const managerLayer = Layer.mergeAll(
285 Layer.succeed(GitHubCli, gitHubCli),
286 Layer.succeed(TextGeneration, textGeneration),
287 gitCoreLayer,
288 NodeServices.layer,
289 );
290
291 return makeGitManager.pipe(
292 Effect.provide(managerLayer),
293 Effect.map((manager) => ({ manager, ghCalls })),
294 );
295}
296
297const GitManagerTestLayer = Layer.provideMerge(GitServiceLive, NodeServices.layer);
298
299it.layer(GitManagerTestLayer)("GitManager", (it) => {
300 it.effect("status includes PR metadata when branch already has an open PR", () =>
301 Effect.gen(function* () {
302 const repoDir = yield* makeTempDir("t3code-git-manager-");
303 yield* initRepo(repoDir);
304 yield* runGit(repoDir, ["checkout", "-b", "feature/status-open-pr"]);
305 const remoteDir = yield* createBareRemote();
306 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
307 yield* runGit(repoDir, ["push", "-u", "origin", "feature/status-open-pr"]);
308
309 const { manager } = yield* makeManager({
310 ghScenario: {
311 prListSequence: [
312 JSON.stringify([
313 {
314 number: 13,
315 title: "Existing PR",
316 url: "https://github.com/pingdotgg/codething-mvp/pull/13",
317 baseRefName: "main",
318 headRefName: "feature/status-open-pr",
319 },
320 ]),
321 ],
322 },
323 });
324
325 const status = yield* manager.status({ cwd: repoDir });
326 expect(status.branch).toBe("feature/status-open-pr");
327 expect(status.pr).toEqual({
328 number: 13,
329 title: "Existing PR",
330 url: "https://github.com/pingdotgg/codething-mvp/pull/13",
331 baseBranch: "main",
332 headBranch: "feature/status-open-pr",
333 state: "open",
334 });
335 }),
336 );
337
338 it.effect("status returns merged PR state when latest PR was merged", () =>
339 Effect.gen(function* () {
340 const repoDir = yield* makeTempDir("t3code-git-manager-");
341 yield* initRepo(repoDir);
342 yield* runGit(repoDir, ["checkout", "-b", "feature/status-merged-pr"]);
343
344 const { manager } = yield* makeManager({
345 ghScenario: {
346 prListSequence: [
347 JSON.stringify([
348 {
349 number: 22,
350 title: "Merged PR",
351 url: "https://github.com/pingdotgg/codething-mvp/pull/22",
352 baseRefName: "main",
353 headRefName: "feature/status-merged-pr",
354 state: "MERGED",
355 mergedAt: "2026-01-30T10:00:00Z",
356 updatedAt: "2026-01-30T10:00:00Z",
357 },
358 ]),
359 ],
360 },
361 });
362
363 const status = yield* manager.status({ cwd: repoDir });
364 expect(status.branch).toBe("feature/status-merged-pr");
365 expect(status.pr).toEqual({
366 number: 22,
367 title: "Merged PR",
368 url: "https://github.com/pingdotgg/codething-mvp/pull/22",
369 baseBranch: "main",
370 headBranch: "feature/status-merged-pr",
371 state: "merged",
372 });
373 }),
374 );
375
376 it.effect("status prefers open PR when merged PR has newer updatedAt", () =>
377 Effect.gen(function* () {
378 const repoDir = yield* makeTempDir("t3code-git-manager-");
379 yield* initRepo(repoDir);
380 yield* runGit(repoDir, ["checkout", "-b", "feature/status-open-over-merged"]);
381
382 const { manager } = yield* makeManager({
383 ghScenario: {
384 prListSequence: [
385 JSON.stringify([
386 {
387 number: 45,
388 title: "Merged PR",
389 url: "https://github.com/pingdotgg/codething-mvp/pull/45",
390 baseRefName: "main",
391 headRefName: "feature/status-open-over-merged",
392 state: "MERGED",
393 mergedAt: "2026-01-31T10:00:00Z",
394 updatedAt: "2026-02-01T10:00:00Z",
395 },
396 {
397 number: 46,
398 title: "Open PR",
399 url: "https://github.com/pingdotgg/codething-mvp/pull/46",
400 baseRefName: "main",
401 headRefName: "feature/status-open-over-merged",
402 state: "OPEN",
403 updatedAt: "2026-01-30T10:00:00Z",
404 },
405 ]),
406 ],
407 },
408 });
409
410 const status = yield* manager.status({ cwd: repoDir });
411 expect(status.branch).toBe("feature/status-open-over-merged");
412 expect(status.pr).toEqual({
413 number: 46,
414 title: "Open PR",
415 url: "https://github.com/pingdotgg/codething-mvp/pull/46",
416 baseBranch: "main",
417 headBranch: "feature/status-open-over-merged",
418 state: "open",
419 });
420 }),
421 );
422
423 it.effect("status is resilient to gh lookup failures and returns pr null", () =>
424 Effect.gen(function* () {
425 const repoDir = yield* makeTempDir("t3code-git-manager-");
426 yield* initRepo(repoDir);
427 yield* runGit(repoDir, ["checkout", "-b", "feature/status-no-gh"]);
428 const remoteDir = yield* createBareRemote();
429 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
430 yield* runGit(repoDir, ["push", "-u", "origin", "feature/status-no-gh"]);
431
432 const { manager } = yield* makeManager({
433 ghScenario: {
434 failWith: new GitHubCliError({
435 operation: "execute",
436 detail: "GitHub CLI (`gh`) is required but not available on PATH.",
437 }),
438 },
439 });
440
441 const status = yield* manager.status({ cwd: repoDir });
442 expect(status.branch).toBe("feature/status-no-gh");
443 expect(status.pr).toBeNull();
444 }),
445 );
446
447 it.effect("creates a commit when working tree is dirty", () =>
448 Effect.gen(function* () {
449 const repoDir = yield* makeTempDir("t3code-git-manager-");
450 yield* initRepo(repoDir);
451 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\nworld\n");
452
453 const { manager } = yield* makeManager();
454 const result = yield* runStackedAction(manager, {
455 cwd: repoDir,
456 action: "commit",
457 });
458
459 expect(result.commit.status).toBe("created");
460 expect(result.push.status).toBe("skipped_not_requested");
461 expect(result.pr.status).toBe("skipped_not_requested");
462 expect(
463 yield* runGit(repoDir, ["log", "-1", "--pretty=%s"]).pipe(
464 Effect.map((result) => result.stdout.trim()),
465 ),
466 ).toBe("Implement stacked git actions");
467 }),
468 );
469
470 it.effect("uses custom commit message when provided", () =>
471 Effect.gen(function* () {
472 const repoDir = yield* makeTempDir("t3code-git-manager-");
473 yield* initRepo(repoDir);
474 fs.writeFileSync(path.join(repoDir, "README.md"), "hello\ncustom\n");
475 let generatedCount = 0;
476
477 const { manager } = yield* makeManager({
478 textGeneration: {
479 generateCommitMessage: () =>
480 Effect.sync(() => {
481 generatedCount += 1;
482 return {
483 subject: "this should not be used",
484 body: "",
485 };
486 }),
487 },
488 });
489 const result = yield* runStackedAction(manager, {
490 cwd: repoDir,
491 action: "commit",
492 commitMessage: "feat: custom summary line\n\n- details from user",
493 });
494
495 expect(result.commit.status).toBe("created");
496 expect(result.commit.subject).toBe("feat: custom summary line");
497 expect(generatedCount).toBe(0);
498 expect(
499 yield* runGit(repoDir, ["log", "-1", "--pretty=%s"]).pipe(
500 Effect.map((result) => result.stdout.trim()),
501 ),
502 ).toBe("feat: custom summary line");
503 expect(
504 yield* runGit(repoDir, ["log", "-1", "--pretty=%b"]).pipe(
505 Effect.map((result) => result.stdout.trim()),
506 ),
507 ).toContain("- details from user");
508 }),
509 );
510
511 it.effect("skips commit when there are no uncommitted changes", () =>
512 Effect.gen(function* () {
513 const repoDir = yield* makeTempDir("t3code-git-manager-");
514 yield* initRepo(repoDir);
515
516 const { manager } = yield* makeManager();
517 const result = yield* runStackedAction(manager, {
518 cwd: repoDir,
519 action: "commit",
520 });
521
522 expect(result.commit.status).toBe("skipped_no_changes");
523 expect(result.push.status).toBe("skipped_not_requested");
524 expect(result.pr.status).toBe("skipped_not_requested");
525 }),
526 );
527
528 it.effect("commits and pushes with upstream auto-setup when needed", () =>
529 Effect.gen(function* () {
530 const repoDir = yield* makeTempDir("t3code-git-manager-");
531 yield* initRepo(repoDir);
532 yield* runGit(repoDir, ["checkout", "-b", "feature/stacked-flow"]);
533 const remoteDir = yield* createBareRemote();
534 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
535 fs.writeFileSync(path.join(repoDir, "feature.txt"), "feature\n");
536
537 const { manager } = yield* makeManager();
538 const result = yield* runStackedAction(manager, {
539 cwd: repoDir,
540 action: "commit_push",
541 });
542
543 expect(result.commit.status).toBe("created");
544 expect(result.push.status).toBe("pushed");
545 expect(result.push.setUpstream).toBe(true);
546 expect(
547 yield* runGit(repoDir, ["rev-parse", "--abbrev-ref", "@{upstream}"]).pipe(
548 Effect.map((result) => result.stdout.trim()),
549 ),
550 ).toBe("origin/feature/stacked-flow");
551 }),
552 );
553
554 it.effect("skips push when branch is already up to date", () =>
555 Effect.gen(function* () {
556 const repoDir = yield* makeTempDir("t3code-git-manager-");
557 yield* initRepo(repoDir);
558 yield* runGit(repoDir, ["checkout", "-b", "feature/up-to-date"]);
559 const remoteDir = yield* createBareRemote();
560 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
561 yield* runGit(repoDir, ["push", "-u", "origin", "feature/up-to-date"]);
562
563 const { manager } = yield* makeManager();
564 const result = yield* runStackedAction(manager, {
565 cwd: repoDir,
566 action: "commit_push",
567 });
568
569 expect(result.commit.status).toBe("skipped_no_changes");
570 expect(result.push.status).toBe("skipped_up_to_date");
571 }),
572 );
573
574 it.effect("returns existing PR metadata for commit/push/pr action", () =>
575 Effect.gen(function* () {
576 const repoDir = yield* makeTempDir("t3code-git-manager-");
577 yield* initRepo(repoDir);
578 yield* runGit(repoDir, ["checkout", "-b", "feature/existing-pr"]);
579 const remoteDir = yield* createBareRemote();
580 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
581 yield* runGit(repoDir, ["push", "-u", "origin", "feature/existing-pr"]);
582
583 const { manager, ghCalls } = yield* makeManager({
584 ghScenario: {
585 prListSequence: [
586 JSON.stringify([
587 {
588 number: 42,
589 title: "Existing PR",
590 url: "https://github.com/pingdotgg/codething-mvp/pull/42",
591 baseRefName: "main",
592 headRefName: "feature/existing-pr",
593 },
594 ]),
595 ],
596 },
597 });
598 const result = yield* runStackedAction(manager, {
599 cwd: repoDir,
600 action: "commit_push_pr",
601 });
602
603 expect(result.pr.status).toBe("opened_existing");
604 expect(result.pr.number).toBe(42);
605 expect(ghCalls.some((call) => call.startsWith("pr view "))).toBe(false);
606 }),
607 );
608
609 it.effect("creates PR when one does not already exist", () =>
610 Effect.gen(function* () {
611 const repoDir = yield* makeTempDir("t3code-git-manager-");
612 yield* initRepo(repoDir);
613 yield* runGit(repoDir, ["checkout", "-b", "feature-create-pr"]);
614 const remoteDir = yield* createBareRemote();
615 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
616 fs.writeFileSync(path.join(repoDir, "changes.txt"), "change\n");
617 yield* runGit(repoDir, ["add", "changes.txt"]);
618 yield* runGit(repoDir, ["commit", "-m", "Feature commit"]);
619 yield* runGit(repoDir, ["push", "-u", "origin", "feature-create-pr"]);
620 yield* runGit(repoDir, ["config", "branch.feature-create-pr.gh-merge-base", "main"]);
621
622 const { manager, ghCalls } = yield* makeManager({
623 ghScenario: {
624 prListSequence: [
625 "[]",
626 JSON.stringify([
627 {
628 number: 88,
629 title: "Add stacked git actions",
630 url: "https://github.com/pingdotgg/codething-mvp/pull/88",
631 baseRefName: "main",
632 headRefName: "feature-create-pr",
633 },
634 ]),
635 ],
636 },
637 });
638 const result = yield* runStackedAction(manager, {
639 cwd: repoDir,
640 action: "commit_push_pr",
641 });
642
643 expect(result.pr.status).toBe("created");
644 expect(result.pr.number).toBe(88);
645 expect(
646 ghCalls.some((call) => call.includes("pr create --base main --head feature-create-pr")),
647 ).toBe(true);
648 expect(ghCalls.some((call) => call.startsWith("pr view "))).toBe(false);
649 }),
650 );
651
652 it.effect("rejects push/pr actions from detached HEAD", () =>
653 Effect.gen(function* () {
654 const repoDir = yield* makeTempDir("t3code-git-manager-");
655 yield* initRepo(repoDir);
656 yield* runGit(repoDir, ["checkout", "--detach", "HEAD"]);
657
658 const { manager } = yield* makeManager();
659 const errorMessage = yield* runStackedAction(manager, {
660 cwd: repoDir,
661 action: "commit_push",
662 }).pipe(
663 Effect.flip,
664 Effect.map((error) => error.message),
665 );
666 expect(errorMessage).toContain("detached HEAD");
667 }),
668 );
669
670 it.effect("surfaces missing gh binary errors", () =>
671 Effect.gen(function* () {
672 const repoDir = yield* makeTempDir("t3code-git-manager-");
673 yield* initRepo(repoDir);
674 yield* runGit(repoDir, ["checkout", "-b", "feature/gh-missing"]);
675 const remoteDir = yield* createBareRemote();
676 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
677 yield* runGit(repoDir, ["push", "-u", "origin", "feature/gh-missing"]);
678
679 const { manager } = yield* makeManager({
680 ghScenario: {
681 failWith: new GitHubCliError({
682 operation: "execute",
683 detail: "GitHub CLI (`gh`) is required but not available on PATH.",
684 }),
685 },
686 });
687
688 const errorMessage = yield* runStackedAction(manager, {
689 cwd: repoDir,
690 action: "commit_push_pr",
691 }).pipe(
692 Effect.flip,
693 Effect.map((error) => error.message),
694 );
695 expect(errorMessage).toContain("GitHub CLI (`gh`) is required");
696 }),
697 );
698
699 it.effect("surfaces gh auth errors with guidance", () =>
700 Effect.gen(function* () {
701 const repoDir = yield* makeTempDir("t3code-git-manager-");
702 yield* initRepo(repoDir);
703 yield* runGit(repoDir, ["checkout", "-b", "feature/gh-auth"]);
704 const remoteDir = yield* createBareRemote();
705 yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
706 yield* runGit(repoDir, ["push", "-u", "origin", "feature/gh-auth"]);
707
708 const { manager } = yield* makeManager({
709 ghScenario: {
710 failWith: new GitHubCliError({
711 operation: "execute",
712 detail: "GitHub CLI is not authenticated. Run `gh auth login` and retry.",
713 }),
714 },
715 });
716
717 const errorMessage = yield* runStackedAction(manager, {
718 cwd: repoDir,
719 action: "commit_push_pr",
720 }).pipe(
721 Effect.flip,
722 Effect.map((error) => error.message),
723 );
724 expect(errorMessage).toContain("gh auth login");
725 }),
726 );
727});