Showing the changes to apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts (1 of 59 files). Show all
Unified · Split
| @@ -2,11 +2,11 @@ import { assert, it } from "@effect/vitest"; · 1 unmodified line | |||
| 2 | import { DateTime, Effect, Layer, Option } from "effect"; | 2 | import { DateTime, Effect, Layer, Option } from "effect"; |
| 3 | import { ChildProcessSpawner } from "effect/unstable/process"; | 3 | import { ChildProcessSpawner } from "effect/unstable/process"; |
| 4 | 4 | ||
| 5 | import { GitHubCli, type GitHubCliShape } from "./GitHubCli.ts"; | 5 | import * as VcsProcess from "../vcs/VcsProcess.ts"; |
| 6 | import type { VcsProcessOutput } from "../vcs/VcsProcess.ts"; | 6 | import * as GitHubCli from "./GitHubCli.ts"; |
| 7 | import * as GitHubSourceControlProvider from "./GitHubSourceControlProvider.ts"; | 7 | import * as GitHubSourceControlProvider from "./GitHubSourceControlProvider.ts"; |
| 8 | 8 | ||
| 9 | const processResult = (stdout: string): VcsProcessOutput => ({ | 9 | const processResult = (stdout: string): VcsProcess.VcsProcessOutput => ({ |
| 10 | exitCode: ChildProcessSpawner.ExitCode(0), | 10 | exitCode: ChildProcessSpawner.ExitCode(0), |
| 11 | stdout, | 11 | stdout, |
| 12 | stderr: "", | 12 | stderr: "", |
| @@ -14,8 +14,10 @@ const processResult = (stdout: string): VcsProcessOutput => ({ · 1 unmodified line | |||
| 14 | stderrTruncated: false, | 14 | stderrTruncated: false, |
| 15 | }); | 15 | }); |
| 16 | 16 | ||
| 17 | function makeProvider(github: Partial<GitHubCliShape>) { | 17 | function makeProvider(github: Partial<GitHubCli.GitHubCliShape>) { |
| 18 | return GitHubSourceControlProvider.make().pipe(Effect.provide(Layer.mock(GitHubCli)(github))); | 18 | return GitHubSourceControlProvider.make().pipe( |
| 19 | Effect.provide(Layer.mock(GitHubCli.GitHubCli)(github)), | ||
| 20 | ); | ||
| 19 | } | 21 | } |
| 20 | 22 | ||
| 21 | it.effect("maps GitHub PR summaries into provider-neutral change requests", () => | 23 | it.effect("maps GitHub PR summaries into provider-neutral change requests", () => |
| @@ -127,7 +129,7 @@ it.effect("treats empty non-open change request listing output as no results", ( · 105 unmodified lines | |||
| 127 | 129 | ||
| 128 | it.effect("creates GitHub PRs through provider-neutral input names", () => | 130 | it.effect("creates GitHub PRs through provider-neutral input names", () => |
| 129 | Effect.gen(function* () { | 131 | Effect.gen(function* () { |
| 130 | let createInput: Parameters<GitHubCliShape["createPullRequest"]>[0] | null = null; | 132 | let createInput: Parameters<GitHubCli.GitHubCliShape["createPullRequest"]>[0] | null = null; |
| 131 | const provider = yield* makeProvider({ | 133 | const provider = yield* makeProvider({ |
| 132 | createPullRequest: (input) => { | 134 | createPullRequest: (input) => { |
| 133 | createInput = input; | 135 | createInput = input; |