File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,12 @@ describe("gptscript module", () => {
241241 expect ( ( response [ 0 ] as gptscript . Tool ) . instructions ) . toEqual ( "who was the president in 1928?" )
242242 } , 30000 )
243243
244+ test ( "parse empty file" , async ( ) => {
245+ const response = await g . parse ( path . join ( __dirname , "fixtures" , "empty.gpt" ) )
246+ expect ( response ) . toBeDefined ( )
247+ expect ( response ) . toHaveLength ( 0 )
248+ } , 30000 )
249+
244250 test ( "parse file with metadata" , async ( ) => {
245251 const response = await g . parse ( path . join ( __dirname , "fixtures" , "parse-with-metadata.gpt" ) )
246252 expect ( response ) . toBeDefined ( )
@@ -258,6 +264,12 @@ describe("gptscript module", () => {
258264 expect ( ( response [ 0 ] as gptscript . Tool ) . instructions ) . toEqual ( tool )
259265 } , 30000 )
260266
267+ test ( "parse empty string tool" , async ( ) => {
268+ const response = await g . parseTool ( "" )
269+ expect ( response ) . toBeDefined ( )
270+ expect ( response ) . toHaveLength ( 0 )
271+ } , 30000 )
272+
261273 test ( "parse string tool with text node" , async ( ) => {
262274 const tool = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?\n---\n!markdown\nThis is a text node"
263275 const response = await g . parseTool ( tool )
You can’t perform that action at this time.
0 commit comments