Skip to content

Commit 2917a2f

Browse files
committed
test: fix
1 parent 1247356 commit 2917a2f

1 file changed

Lines changed: 40 additions & 39 deletions

File tree

packages/opencode/test/tool/question.test.ts

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -63,43 +63,44 @@ describe("tool.question", () => {
6363
expect(result.output).toContain(`"What is your favorite animal?"="Dog"`)
6464
})
6565

66-
test("should throw an Error for header exceeding 30 characters", async () => {
67-
const tool = await QuestionTool.init()
68-
const questions = [
69-
{
70-
question: "What is your favorite animal?",
71-
header: "This Header is Definitely More Than Thirty Characters Long",
72-
options: [{ label: "Dog", description: "Man's best friend" }],
73-
},
74-
]
75-
try {
76-
await tool.execute({ questions }, ctx)
77-
// If it reaches here, the test should fail
78-
expect(true).toBe(false)
79-
} catch (e: any) {
80-
expect(e).toBeInstanceOf(Error)
81-
expect(e.cause).toBeInstanceOf(z.ZodError)
82-
}
83-
})
66+
// intentionally removed the zod validation due to tool call errors, hoping prompting is gonna be good enough
67+
// test("should throw an Error for header exceeding 30 characters", async () => {
68+
// const tool = await QuestionTool.init()
69+
// const questions = [
70+
// {
71+
// question: "What is your favorite animal?",
72+
// header: "This Header is Definitely More Than Thirty Characters Long",
73+
// options: [{ label: "Dog", description: "Man's best friend" }],
74+
// },
75+
// ]
76+
// try {
77+
// await tool.execute({ questions }, ctx)
78+
// // If it reaches here, the test should fail
79+
// expect(true).toBe(false)
80+
// } catch (e: any) {
81+
// expect(e).toBeInstanceOf(Error)
82+
// expect(e.cause).toBeInstanceOf(z.ZodError)
83+
// }
84+
// })
8485

85-
test("should throw an Error for label exceeding 30 characters", async () => {
86-
const tool = await QuestionTool.init()
87-
const questions = [
88-
{
89-
question: "A question with a very long label",
90-
header: "Long Label",
91-
options: [
92-
{ label: "This is a very, very, very long label that will exceed the limit", description: "A description" },
93-
],
94-
},
95-
]
96-
try {
97-
await tool.execute({ questions }, ctx)
98-
// If it reaches here, the test should fail
99-
expect(true).toBe(false)
100-
} catch (e: any) {
101-
expect(e).toBeInstanceOf(Error)
102-
expect(e.cause).toBeInstanceOf(z.ZodError)
103-
}
104-
})
105-
})
86+
// test("should throw an Error for label exceeding 30 characters", async () => {
87+
// const tool = await QuestionTool.init()
88+
// const questions = [
89+
// {
90+
// question: "A question with a very long label",
91+
// header: "Long Label",
92+
// options: [
93+
// { label: "This is a very, very, very long label that will exceed the limit", description: "A description" },
94+
// ],
95+
// },
96+
// ]
97+
// try {
98+
// await tool.execute({ questions }, ctx)
99+
// // If it reaches here, the test should fail
100+
// expect(true).toBe(false)
101+
// } catch (e: any) {
102+
// expect(e).toBeInstanceOf(Error)
103+
// expect(e.cause).toBeInstanceOf(z.ZodError)
104+
// }
105+
// })
106+
// })

0 commit comments

Comments
 (0)