Skip to content

Commit eb22a6b

Browse files
committed
fix(tests): type controller-ready reachability mock
Proof of fix: - Cause: the new controller drift regression mocked findReachableApiBaseUrl as success-only, but the test intentionally returns typed ControllerBootstrapError failures. - Solution: widen the mock signature to Effect<string, ControllerBootstrapError>. - Evidence: bun run typecheck and vitest controller-ready both pass locally.
1 parent 3172b61 commit eb22a6b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/app/tests/docker-git/controller-ready.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { describe, expect, it } from "@effect/vitest"
44
import { Effect } from "effect"
55
import { beforeEach, vi } from "vitest"
66

7+
type ControllerBootstrapError = {
8+
readonly _tag: "ControllerBootstrapError"
9+
readonly message: string
10+
}
11+
712
const prepareLocalControllerRevisionMock = vi.hoisted(() => vi.fn<() => Effect.Effect<string>>())
813
const controllerExistsMock = vi.hoisted(() => vi.fn<() => Effect.Effect<boolean>>())
914
const inspectControllerRevisionMock = vi.hoisted(() => vi.fn<() => Effect.Effect<string | null>>())
@@ -20,7 +25,13 @@ const findReachableDirectHealthProbeMock = vi.hoisted(
2025
>()
2126
)
2227
const findReachableApiBaseUrlMock = vi.hoisted(
23-
() => vi.fn<(candidateUrls: ReadonlyArray<string>, expectedRevision?: string) => Effect.Effect<string>>()
28+
() =>
29+
vi.fn<
30+
(
31+
candidateUrls: ReadonlyArray<string>,
32+
expectedRevision?: string
33+
) => Effect.Effect<string, ControllerBootstrapError>
34+
>()
2435
)
2536
const prepareControllerResourceLimitEnvMock = vi.hoisted(() => vi.fn<() => Effect.Effect<void>>())
2637
const prepareControllerRuntimeEnvMock = vi.hoisted(() => vi.fn<() => Effect.Effect<void>>())

0 commit comments

Comments
 (0)