@@ -63,44 +63,44 @@ describe("tool.question", () => { |
63 | 63 | expect(result.output).toContain(`"What is your favorite animal?"="Dog"`) |
64 | 64 | }) |
65 | 65 |
|
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 | | -// }) |
| 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 | + // }) |
85 | 85 |
|
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 | | -// }) |
| 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 | +}) |