Showing the changes to apps/server/src/sourceControl/GitLabSourceControlProvider.test.ts (1 of 59 files). Show all
Unified · Split
| @@ -1,11 +1,13 @@ | |||
| 1 | import { assert, it } from "@effect/vitest"; | 1 | import { assert, it } from "@effect/vitest"; |
| 2 | import { Effect, Layer, Option } from "effect"; | 2 | import { Effect, Layer, Option } from "effect"; |
| 3 | 3 | ||
| 4 | import { GitLabCli, type GitLabCliShape } from "./GitLabCli.ts"; | 4 | import * as GitLabCli from "./GitLabCli.ts"; |
| 5 | import * as GitLabSourceControlProvider from "./GitLabSourceControlProvider.ts"; | 5 | import * as GitLabSourceControlProvider from "./GitLabSourceControlProvider.ts"; |
| 6 | 6 | ||
| 7 | function makeProvider(gitlab: Partial<GitLabCliShape>) { | 7 | function makeProvider(gitlab: Partial<GitLabCli.GitLabCliShape>) { |
| 8 | return GitLabSourceControlProvider.make().pipe(Effect.provide(Layer.mock(GitLabCli)(gitlab))); | 8 | return GitLabSourceControlProvider.make().pipe( |
| 9 | Effect.provide(Layer.mock(GitLabCli.GitLabCli)(gitlab)), | ||
| 10 | ); | ||
| 9 | } | 11 | } |
| 10 | 12 | ||
| 11 | it.effect("maps GitLab MR summaries into provider-neutral change requests", () => | 13 | it.effect("maps GitLab MR summaries into provider-neutral change requests", () => |
| @@ -48,7 +50,7 @@ it.effect("maps GitLab MR summaries into provider-neutral change requests", () = · 36 unmodified lines | |||
| 48 | 50 | ||
| 49 | it.effect("lists GitLab MRs through provider-neutral input names", () => | 51 | it.effect("lists GitLab MRs through provider-neutral input names", () => |
| 50 | Effect.gen(function* () { | 52 | Effect.gen(function* () { |
| 51 | let listInput: Parameters<GitLabCliShape["listMergeRequests"]>[0] | null = null; | 53 | let listInput: Parameters<GitLabCli.GitLabCliShape["listMergeRequests"]>[0] | null = null; |
| 52 | const provider = yield* makeProvider({ | 54 | const provider = yield* makeProvider({ |
| 53 | listMergeRequests: (input) => { | 55 | listMergeRequests: (input) => { |
| 54 | listInput = input; | 56 | listInput = input; |
| @@ -74,7 +76,7 @@ it.effect("lists GitLab MRs through provider-neutral input names", () => · 19 unmodified lines | |||
| 74 | 76 | ||
| 75 | it.effect("creates GitLab MRs through provider-neutral input names", () => | 77 | it.effect("creates GitLab MRs through provider-neutral input names", () => |
| 76 | Effect.gen(function* () { | 78 | Effect.gen(function* () { |
| 77 | let createInput: Parameters<GitLabCliShape["createMergeRequest"]>[0] | null = null; | 79 | let createInput: Parameters<GitLabCli.GitLabCliShape["createMergeRequest"]>[0] | null = null; |
| 78 | const provider = yield* makeProvider({ | 80 | const provider = yield* makeProvider({ |
| 79 | createMergeRequest: (input) => { | 81 | createMergeRequest: (input) => { |
| 80 | createInput = input; | 82 | createInput = input; |