Merge pull request #12 from Pet3cy/fix-testing-improvement-parse-file-template-variables-6142620025282989819

🧪 [testing improvement] validate non-string file paths in parseFileTemplateVariables
This commit is contained in:
Pet3cy
2026-02-25 05:12:54 +01:00
committed by GitHub

View File

@@ -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",
)
})
})
})