@@ -19,7 +19,8 @@ describe('createInterpreterTool', () => {
19
19
const sum = a + b
20
20
console.log('sum =', sum)
21
21
return sum
22
- `
22
+ ` ,
23
+ timeout : 5000
23
24
} , { } as any ) as string
24
25
const executionTime = Date . now ( ) - startTime
25
26
@@ -42,7 +43,8 @@ describe('createInterpreterTool', () => {
42
43
console.log('Before error')
43
44
throw new Error('Test error')
44
45
console.log('After error')
45
- `
46
+ ` ,
47
+ timeout : 5000
46
48
} , { } as any ) as string
47
49
48
50
expect ( result ) . toContain ( 'Test error' )
@@ -59,7 +61,8 @@ describe('createInterpreterTool', () => {
59
61
const obj = { name: 'test', value: 42, nested: { key: 'value' } }
60
62
console.log('Object:', obj)
61
63
console.log('Array:', [1, 2, 3])
62
- `
64
+ ` ,
65
+ timeout : 5000
63
66
} , { } as any ) as string
64
67
65
68
expect ( result ) . toMatchInlineSnapshot ( `
@@ -107,7 +110,8 @@ describe('createInterpreterTool', () => {
107
110
const value = await promise
108
111
console.log('Promise value:', value)
109
112
return 'done'
110
- `
113
+ ` ,
114
+ timeout : 5000
111
115
} , { } as any ) as string
112
116
113
117
expect ( result ) . toMatchInlineSnapshot ( `
@@ -147,7 +151,8 @@ describe('createInterpreterTool', () => {
147
151
const b = 10
148
152
const sum = a + b
149
153
return sum
150
- `
154
+ ` ,
155
+ timeout : 5000
151
156
} , { } as any ) as string
152
157
153
158
expect ( result ) . toBe ( 'no console logs' )
@@ -171,7 +176,8 @@ describe('createInterpreterTool', () => {
171
176
}
172
177
173
178
main()
174
- `
179
+ ` ,
180
+ timeout : 5000
175
181
} , { } as any ) as string
176
182
177
183
expect ( result ) . toMatchInlineSnapshot ( `
@@ -230,7 +236,8 @@ describe('createInterpreterTool', () => {
230
236
console.log('Greeting:', greeting)
231
237
232
238
console.log('Done')
233
- `
239
+ ` ,
240
+ timeout : 5000
234
241
} , { } as any ) as string
235
242
236
243
expect ( result ) . toMatchInlineSnapshot ( `
@@ -267,7 +274,8 @@ describe('createInterpreterTool', () => {
267
274
} catch (error) {
268
275
console.log('Error caught:', error.message)
269
276
}
270
- `
277
+ ` ,
278
+ timeout : 5000
271
279
} , { } as any ) as string
272
280
273
281
expect ( result ) . toContain ( 'Invalid input for tool multiply' )
@@ -294,7 +302,8 @@ describe('createInterpreterTool', () => {
294
302
console.timeEnd('myTimer')
295
303
296
304
console.log('Sum calculated:', sum)
297
- `
305
+ ` ,
306
+ timeout : 5000
298
307
} , { } as any ) as string
299
308
300
309
expect ( result ) . toMatch ( / T h i s i s l o g / )
@@ -328,7 +337,8 @@ describe('createInterpreterTool', () => {
328
337
code : `
329
338
console.log('Tools available:', Object.keys(tools))
330
339
console.log('No tools should be available')
331
- `
340
+ ` ,
341
+ timeout : 5000
332
342
} , { } as any ) as string
333
343
334
344
expect ( result ) . toMatchInlineSnapshot ( `
@@ -437,7 +447,8 @@ describe('createInterpreterTool', () => {
437
447
438
448
const relative = new URL('/api/users', 'https://api.example.com')
439
449
console.log('Full URL:', relative.href)
440
- `
450
+ ` ,
451
+ timeout : 5000
441
452
} , { } as any ) as string
442
453
443
454
expect ( result ) . toMatchInlineSnapshot ( `
@@ -556,7 +567,8 @@ describe('createInterpreterTool', () => {
556
567
})
557
568
558
569
console.log('User 1 file:', userFile.substring(0, 20) + '...')
559
- `
570
+ ` ,
571
+ timeout : 5000
560
572
} , { } as any ) as string
561
573
562
574
expect ( result ) . toMatchInlineSnapshot ( `
0 commit comments