test(recipes): type the forwarded-env handler fake instead of casting its result

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Neil
2026-11-12 22:49:42 -08:00
co-authored by Claude
parent 4ea9f12880
commit b6fdb18033
@@ -1,6 +1,7 @@
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
const handlers = new Map<string, (_event: unknown, args?: unknown) => unknown>()
// The only channel registered here returns a summary.
const handlers = new Map<string, (_event: unknown, args?: unknown) => RecipeForwardedEnvSummary>()
const { listRuntimesMock, recipeContextMock } = vi.hoisted(() => ({
listRuntimesMock: vi.fn(),
recipeContextMock: vi.fn()
@@ -31,7 +32,7 @@ function summarize(args?: unknown): RecipeForwardedEnvSummary {
if (!handler) {
throw new Error('handler not registered')
}
return handler({}, args) as RecipeForwardedEnvSummary
return handler({}, args)
}
beforeEach(() => {