1- import { afterAll , beforeAll , beforeEach , describe , expect , it , test } from 'bun:test'
1+ import {
2+ afterAll ,
3+ beforeAll ,
4+ beforeEach ,
5+ describe ,
6+ expect ,
7+ it ,
8+ test ,
9+ } from 'bun:test'
210
311import { validateAgents } from '../templates/agent-validation'
412import { DynamicAgentConfigSchema } from '../types/dynamic-agent-template'
@@ -216,7 +224,7 @@ describe('Agent Validation', () => {
216224 instructionsPrompt : 'Test user prompt' ,
217225 stepPrompt : 'Test step prompt' ,
218226 inputSchema : {
219- prompt : null as any , // Invalid - null schema
227+ prompt : { } as any , // invalid prompt schema
220228 } ,
221229 outputMode : 'last_message' ,
222230 includeMessageHistory : true ,
@@ -230,7 +238,7 @@ describe('Agent Validation', () => {
230238
231239 expect ( result . validationErrors ) . toHaveLength ( 1 )
232240 expect ( result . validationErrors [ 0 ] . message ) . toContain (
233- 'Failed to convert inputSchema.prompt to Zod ' ,
241+ 'Invalid inputSchema.prompt in invalid-schema-agent.ts ' ,
234242 )
235243 expect ( result . templates ) . not . toHaveProperty ( 'invalid_schema_agent' )
236244 } )
@@ -538,7 +546,7 @@ describe('Agent Validation', () => {
538546 instructionsPrompt : 'Test user prompt' ,
539547 stepPrompt : 'Test step prompt' ,
540548 inputSchema : {
541- prompt : null as any , // Invalid - null schema
549+ prompt : 10 as any , // Invalid - number schema
542550 } ,
543551 outputMode : 'last_message' ,
544552 includeMessageHistory : true ,
@@ -813,8 +821,10 @@ describe('Agent Validation', () => {
813821 expect ( result . templates [ 'test-agent' ] ) . toBeDefined ( )
814822
815823 // Verify the loaded template's handleSteps field matches the original toString
816- expect ( result . templates [ 'test-agent' ] . handleSteps ) . toBe ( expectedStringified )
824+ expect ( result . templates [ 'test-agent' ] . handleSteps ) . toBe (
825+ expectedStringified ,
826+ )
817827 expect ( typeof result . templates [ 'test-agent' ] . handleSteps ) . toBe ( 'string' )
818828 } )
819829 } )
820- } )
830+ } )
0 commit comments