@@ -290,8 +290,9 @@ describe('JSON-RPC 2.0 Protocol Integration Tests', () => {
290290 it ( 'should handle method not found (-32601)' , async ( ) => {
291291 try {
292292 // Simulate calling non-existent method
293- await kernel . repository . find ( 'nonexistent' , { } ) ;
294- expect ( true ) . toBe ( true ) ; // Driver may return empty
293+ const result = await kernel . repository . find ( 'nonexistent' , { } ) ;
294+ // Driver returns empty array for unknown collections
295+ expect ( Array . isArray ( result ) ) . toBe ( true ) ;
295296 } catch ( error ) {
296297 expect ( error ) . toBeDefined ( ) ;
297298 }
@@ -311,11 +312,11 @@ describe('JSON-RPC 2.0 Protocol Integration Tests', () => {
311312
312313 it ( 'should handle application errors' , async ( ) => {
313314 try {
314- await kernel . repository . update ( 'tasks' , 'non-existent' , {
315+ const result = await kernel . repository . update ( 'tasks' , 'non-existent' , {
315316 title : 'Updated'
316317 } ) ;
317- // May return null or throw
318- expect ( true ) . toBe ( true ) ;
318+ // MemoryDriver returns null for non-existent records in non-strict mode
319+ expect ( result ) . toBeNull ( ) ;
319320 } catch ( error ) {
320321 expect ( error ) . toBeDefined ( ) ;
321322 }
@@ -559,17 +560,19 @@ describe('JSON-RPC 2.0 Protocol Integration Tests', () => {
559560 describe ( 'Error Handling and Recovery' , ( ) => {
560561 it ( 'should handle null parameters gracefully' , async ( ) => {
561562 try {
562- await kernel . repository . find ( 'tasks' , null as any ) ;
563- expect ( true ) . toBe ( true ) ;
563+ const result = await kernel . repository . find ( 'tasks' , null as any ) ;
564+ // Driver handles null query gracefully — returns records or empty array
565+ expect ( result ) . toBeDefined ( ) ;
564566 } catch ( error ) {
565567 expect ( error ) . toBeDefined ( ) ;
566568 }
567569 } ) ;
568570
569571 it ( 'should handle empty object name' , async ( ) => {
570572 try {
571- await kernel . repository . find ( '' , { } ) ;
572- expect ( true ) . toBe ( true ) ;
573+ const result = await kernel . repository . find ( '' , { } ) ;
574+ // Driver returns empty array for unknown/empty collection names
575+ expect ( Array . isArray ( result ) ) . toBe ( true ) ;
573576 } catch ( error ) {
574577 expect ( error ) . toBeDefined ( ) ;
575578 }
0 commit comments