From de21f4dcd74037dc48d255e06ec27fd58187367b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 9 Mar 2026 16:56:48 -0700 Subject: [PATCH] Use GitHubCliLive as default test layer - Wire `it.layer` to `GitHubCliLive` in `GitHubCli.test.ts` - Remove redundant `Effect.provide(GitHubCliLive)` calls in individual tests --- apps/server/src/git/Layers/GitHubCli.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/server/src/git/Layers/GitHubCli.test.ts b/apps/server/src/git/Layers/GitHubCli.test.ts index 2a75aa47631e7a5260435829d6aff59f4131bb80..aafc796db300b0899724f7dcaf47ea6a75ac3b4c 100644 --- a/apps/server/src/git/Layers/GitHubCli.test.ts +++ b/apps/server/src/git/Layers/GitHubCli.test.ts @@ -1,5 +1,5 @@ import { assert, it } from "@effect/vitest"; -import { Effect, Layer } from "effect"; +import { Effect } from "effect"; import { afterEach, expect, vi } from "vitest"; vi.mock("../../processRunner", () => ({ @@ -11,7 +11,7 @@ import { GitHubCli } from "../Services/GitHubCli.ts"; import { GitHubCliLive } from "./GitHubCli.ts"; const mockedRunProcess = vi.mocked(runProcess); -const layer = it.layer(Layer.empty); +const layer = it.layer(GitHubCliLive); afterEach(() => { mockedRunProcess.mockReset(); @@ -49,7 +49,7 @@ layer("GitHubCliLive", (it) => { cwd: "/repo", reference: "#42", }); - }).pipe(Effect.provide(GitHubCliLive)); + }); assert.deepStrictEqual(result, { number: 42, @@ -96,7 +96,7 @@ layer("GitHubCliLive", (it) => { cwd: "/repo", repository: "octocat/codething-mvp", }); - }).pipe(Effect.provide(GitHubCliLive)); + }); assert.deepStrictEqual(result, { nameWithOwner: "octocat/codething-mvp", @@ -120,7 +120,7 @@ layer("GitHubCliLive", (it) => { cwd: "/repo", reference: "4888", }); - }).pipe(Effect.provide(GitHubCliLive), Effect.flip); + }).pipe(Effect.flip); assert.equal(error.message.includes("Pull request not found"), true); }), -- 2.54.0