@@ -885,14 +885,8 @@ describe('RPC Server', function () {
885885 for ( let i = 0 ; i < 101 ; i ++ ) {
886886 requests . push ( getEthChainIdRequest ( i + 1 ) ) ;
887887 }
888-
889- // execute batch request
890- try {
891- await testClient . post ( '/' , requests ) ;
892- Assertions . expectedError ( ) ;
893- } catch ( error : any ) {
894- BaseTest . batchRequestLimitError ( error . response , requests . length , 100 ) ;
895- }
888+ const response = await testClient . post ( '/' , requests ) ;
889+ BaseTest . batchRequestLimitError ( response , requests . length , 100 ) ;
896890 } ) ;
897891
898892 withOverriddenEnvsInMochaTest ( { BATCH_REQUESTS_ENABLED : false } , async function ( ) {
@@ -3410,10 +3404,12 @@ class BaseTest {
34103404 }
34113405
34123406 static batchRequestLimitError ( response : any , amount : number , max : number ) {
3413- expect ( response . status ) . to . eq ( 400 ) ;
3414- expect ( response . statusText ) . to . be . equal ( 'Bad Request' ) ;
3415- expect ( response . data . error . message ) . to . match ( requestIdRegex ( `Batch request amount ${ amount } exceeds max ${ max } ` ) ) ;
3416- expect ( response . data . error . code ) . to . eq ( - 32203 ) ;
3407+ expect ( response . status ) . to . eq ( 200 ) ;
3408+ expect ( response . statusText ) . to . be . equal ( 'OK' ) ;
3409+ expect ( response . data [ 0 ] . error . message ) . to . match (
3410+ requestIdRegex ( `Batch request amount ${ amount } exceeds max ${ max } ` ) ,
3411+ ) ;
3412+ expect ( response . data [ 0 ] . error . code ) . to . eq ( - 32203 ) ;
34173413 }
34183414
34193415 static invalidParamError ( response : any , code : number , message : string ) {
0 commit comments