@@ -791,6 +791,48 @@ This is a test agent that handles various tasks.
791791 const result = validateAgentContent ( content )
792792 expect ( result . valid ) . toBe ( true )
793793 } )
794+
795+ it ( "should throw TypeError for null input" , ( ) => {
796+ expect ( ( ) => validateAgentContent ( null as unknown as string ) ) . toThrow ( TypeError )
797+ expect ( ( ) => validateAgentContent ( null as unknown as string ) ) . toThrow (
798+ "validateAgentContent: content must be a string, got null" ,
799+ )
800+ } )
801+
802+ it ( "should throw TypeError for undefined input" , ( ) => {
803+ expect ( ( ) => validateAgentContent ( undefined as unknown as string ) ) . toThrow ( TypeError )
804+ expect ( ( ) => validateAgentContent ( undefined as unknown as string ) ) . toThrow (
805+ "validateAgentContent: content must be a string, got undefined" ,
806+ )
807+ } )
808+
809+ it ( "should throw TypeError for number input" , ( ) => {
810+ expect ( ( ) => validateAgentContent ( 123 as unknown as string ) ) . toThrow ( TypeError )
811+ expect ( ( ) => validateAgentContent ( 123 as unknown as string ) ) . toThrow (
812+ "validateAgentContent: content must be a string, got number" ,
813+ )
814+ } )
815+
816+ it ( "should throw TypeError for object input" , ( ) => {
817+ expect ( ( ) => validateAgentContent ( { } as unknown as string ) ) . toThrow ( TypeError )
818+ expect ( ( ) => validateAgentContent ( { } as unknown as string ) ) . toThrow (
819+ "validateAgentContent: content must be a string, got object" ,
820+ )
821+ } )
822+
823+ it ( "should throw TypeError for array input" , ( ) => {
824+ expect ( ( ) => validateAgentContent ( [ ] as unknown as string ) ) . toThrow ( TypeError )
825+ expect ( ( ) => validateAgentContent ( [ ] as unknown as string ) ) . toThrow (
826+ "validateAgentContent: content must be a string, got object" ,
827+ )
828+ } )
829+
830+ it ( "should throw TypeError for boolean input" , ( ) => {
831+ expect ( ( ) => validateAgentContent ( true as unknown as string ) ) . toThrow ( TypeError )
832+ expect ( ( ) => validateAgentContent ( true as unknown as string ) ) . toThrow (
833+ "validateAgentContent: content must be a string, got boolean" ,
834+ )
835+ } )
794836 } )
795837
796838 describe ( "checkVersionCompatibility" , ( ) => {
0 commit comments