test(tools): remove unsafe test assertions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -51,9 +51,9 @@ describe("normalizeHashlineEdits", () => {
|
||||
|
||||
it("rejects legacy payload without op", () => {
|
||||
//#given
|
||||
const input = [{ type: "set_line", line: "2#VK", text: "updated" }] as unknown as Parameters<
|
||||
const input = testCoerce<Parameters<
|
||||
typeof normalizeHashlineEdits
|
||||
>[0]
|
||||
>[0]>([{ type: "set_line", line: "2#VK", text: "updated" }])
|
||||
|
||||
//#when / #then
|
||||
expect(() => normalizeHashlineEdits(input)).toThrow(/legacy format was removed/i)
|
||||
|
||||
@@ -8,14 +8,14 @@ import * as os from "node:os"
|
||||
import * as path from "node:path"
|
||||
|
||||
function createMockContext(): ToolContext {
|
||||
return {
|
||||
return testCoerce<ToolContext>({
|
||||
sessionID: "test",
|
||||
messageID: "test",
|
||||
agent: "test",
|
||||
abort: new AbortController().signal,
|
||||
metadata: mock(() => {}),
|
||||
ask: async () => {},
|
||||
} as unknown as ToolContext
|
||||
})
|
||||
}
|
||||
|
||||
describe("createHashlineEditTool", () => {
|
||||
|
||||
Reference in New Issue
Block a user