authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-09 16:56:48-07:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-09 22:50:45-07:00
logde21f4dcd74037dc48d255e06ec27fd58187367b
tree0ea762955db1d0f0e1fd76dd0bf312133bfc2c11
parent442bc9540ea52e82ad15aee06e52da2c5e16f948

Use GitHubCliLive as default test layer

- Wire `it.layer` to `GitHubCliLive` in `GitHubCli.test.ts` - Remove redundant `Effect.provide(GitHubCliLive)` calls in individual tests

1 files changed, 5 insertions(+), 5 deletions(-)

apps/server/src/git/Layers/GitHubCli.test.ts+5-5
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1import { assert, it } from "@effect/vitest";1import { assert, it } from "@effect/vitest";
2import { Effect, Layer } from "effect";2import { Effect } from "effect";
3import { afterEach, expect, vi } from "vitest";3import { afterEach, expect, vi } from "vitest";
44
5vi.mock("../../processRunner", () => ({5vi.mock("../../processRunner", () => ({
...@@ -11,7 +11,7 @@ import { GitHubCli } from "../Services/GitHubCli.ts";...@@ -11,7 +11,7 @@ import { GitHubCli } from "../Services/GitHubCli.ts";
11import { GitHubCliLive } from "./GitHubCli.ts";11import { GitHubCliLive } from "./GitHubCli.ts";
1212
13const mockedRunProcess = vi.mocked(runProcess);13const mockedRunProcess = vi.mocked(runProcess);
14const layer = it.layer(Layer.empty);14const layer = it.layer(GitHubCliLive);
1515
16afterEach(() => {16afterEach(() => {
17 mockedRunProcess.mockReset();17 mockedRunProcess.mockReset();
...@@ -49,7 +49,7 @@ layer("GitHubCliLive", (it) => {...@@ -49,7 +49,7 @@ layer("GitHubCliLive", (it) => {
49 cwd: "/repo",49 cwd: "/repo",
50 reference: "#42",50 reference: "#42",
51 });51 });
52 }).pipe(Effect.provide(GitHubCliLive));52 });
5353
54 assert.deepStrictEqual(result, {54 assert.deepStrictEqual(result, {
55 number: 42,55 number: 42,
...@@ -96,7 +96,7 @@ layer("GitHubCliLive", (it) => {...@@ -96,7 +96,7 @@ layer("GitHubCliLive", (it) => {
96 cwd: "/repo",96 cwd: "/repo",
97 repository: "octocat/codething-mvp",97 repository: "octocat/codething-mvp",
98 });98 });
99 }).pipe(Effect.provide(GitHubCliLive));99 });
100100
101 assert.deepStrictEqual(result, {101 assert.deepStrictEqual(result, {
102 nameWithOwner: "octocat/codething-mvp",102 nameWithOwner: "octocat/codething-mvp",
...@@ -120,7 +120,7 @@ layer("GitHubCliLive", (it) => {...@@ -120,7 +120,7 @@ layer("GitHubCliLive", (it) => {
120 cwd: "/repo",120 cwd: "/repo",
121 reference: "4888",121 reference: "4888",
122 });122 });
123 }).pipe(Effect.provide(GitHubCliLive), Effect.flip);123 }).pipe(Effect.flip);
124124
125 assert.equal(error.message.includes("Pull request not found"), true);125 assert.equal(error.message.includes("Pull request not found"), true);
126 }),126 }),