test: make unsafe test coercion explicit
Move test coercion out of a hidden global and require each test to import the helper so review tools and runtime scripts can see the unsafe boundary. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { describe, it, expect, beforeEach } from "bun:test"
|
||||
import { createEditErrorRecoveryHook, EDIT_ERROR_REMINDER, EDIT_ERROR_PATTERNS } from "./index"
|
||||
import { unsafeTestValue } from "../../../test-support/unsafe-test-value"
|
||||
|
||||
describe("createEditErrorRecoveryHook", () => {
|
||||
let hook: ReturnType<typeof createEditErrorRecoveryHook>
|
||||
|
||||
beforeEach(() => {
|
||||
hook = createEditErrorRecoveryHook(testCoerce({}))
|
||||
hook = createEditErrorRecoveryHook(unsafeTestValue({}))
|
||||
})
|
||||
|
||||
describe("tool.execute.after", () => {
|
||||
@@ -108,7 +109,7 @@ describe("createEditErrorRecoveryHook", () => {
|
||||
const input = createInput("Edit")
|
||||
const output = {
|
||||
title: "Edit",
|
||||
output: testCoerce<string>(undefined),
|
||||
output: unsafeTestValue<string>(undefined),
|
||||
metadata: {},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user