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", () => {
241
241
expect ( ( response [ 0 ] as gptscript . Tool ) . instructions ) . toEqual ( "who was the president in 1928?" )
242
242
} , 30000 )
243
243
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
+
244
250
test ( "parse file with metadata" , async ( ) => {
245
251
const response = await g . parse ( path . join ( __dirname , "fixtures" , "parse-with-metadata.gpt" ) )
246
252
expect ( response ) . toBeDefined ( )
@@ -258,6 +264,12 @@ describe("gptscript module", () => {
258
264
expect ( ( response [ 0 ] as gptscript . Tool ) . instructions ) . toEqual ( tool )
259
265
} , 30000 )
260
266
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
+
261
273
test ( "parse string tool with text node" , async ( ) => {
262
274
const tool = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?\n---\n!markdown\nThis is a text node"
263
275
const response = await g . parseTool ( tool )
You can’t perform that action at this time.
0 commit comments