From a2600c61b707521723e4a146a87af380bff21c6a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 04:12:17 +0000 Subject: [PATCH] test: validate non-string file paths in parseFileTemplateVariables Add test cases to verify that `parseFileTemplateVariables` correctly throws an error when a non-string value (e.g. number, boolean, object) is provided as a file path in the input YAML. This ensures the existing validation is properly tested. Co-authored-by: Pet3cy <169947521+Pet3cy@users.noreply.github.com> --- __tests__/prompt.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/__tests__/prompt.test.ts b/__tests__/prompt.test.ts index 2eba81d..686eacd 100644 --- a/__tests__/prompt.test.ts +++ b/__tests__/prompt.test.ts @@ -135,5 +135,17 @@ describe('prompt.ts', () => { it('errors on missing files', () => { expect(() => parseFileTemplateVariables('x: ./does-not-exist.txt')).toThrow('was not found') }) + + it('errors on non-string file paths', () => { + expect(() => parseFileTemplateVariables('x: 123')).toThrow( + "File template variable 'x' must be a string file path", + ) + expect(() => parseFileTemplateVariables('x: true')).toThrow( + "File template variable 'x' must be a string file path", + ) + expect(() => parseFileTemplateVariables('x: { nested: "object" }')).toThrow( + "File template variable 'x' must be a string file path", + ) + }) }) })