refactor(repository): type cache failures (#28188)

This commit is contained in:
Shoubhit Dash
2026-05-18 21:46:18 +05:30
committed by GitHub
parent 96192495ae
commit 94828eb44b
3 changed files with 165 additions and 16 deletions

View File

@@ -225,4 +225,21 @@ describe("tool.repo_clone", () => {
}),
),
)
it.live("rejects invalid branch inputs", () =>
provideTmpdirInstance((_dir) =>
Effect.gen(function* () {
const tool = yield* init()
const result = yield* tool.execute({ repository: "owner/repo", branch: "bad..branch" }, ctx).pipe(Effect.exit)
expect(Exit.isFailure(result)).toBe(true)
if (Exit.isFailure(result)) {
const error = Cause.squash(result.cause)
expect(error instanceof Error ? error.message : String(error)).toContain(
"Branch must contain only alphanumeric characters",
)
}
}),
),
)
})