@@ -922,4 +922,33 @@ describe('Config', () => {
922922 }
923923 } ) ;
924924 } ) ;
925+
926+ describe ( 'objectKeyByteLimit' , ( ) => {
927+ it ( 'should use default objectKeyByteLimit (915) from arsenal constants' , ( ) => {
928+ const config = new ConfigObject ( ) ;
929+ assert . strictEqual ( config . objectKeyByteLimit , 915 ) ;
930+ } ) ;
931+
932+ it ( 'should override objectKeyByteLimit from environment variable' , ( ) => {
933+ setEnv ( 'OVERRIDE_OBJECT_KEY_BYTE_LIMIT' , '2048' ) ;
934+ const config = new ConfigObject ( ) ;
935+ assert . strictEqual ( config . objectKeyByteLimit , 2048 ) ;
936+ } ) ;
937+
938+ it ( 'should allow setting objectKeyByteLimit to 0 (no limit)' , ( ) => {
939+ setEnv ( 'OVERRIDE_OBJECT_KEY_BYTE_LIMIT' , '0' ) ;
940+ const config = new ConfigObject ( ) ;
941+ assert . strictEqual ( config . objectKeyByteLimit , 0 ) ;
942+ } ) ;
943+
944+ it ( 'should throw error for negative objectKeyByteLimit override' , ( ) => {
945+ setEnv ( 'OVERRIDE_OBJECT_KEY_BYTE_LIMIT' , '-1' ) ;
946+ assert . throws ( ( ) => new ConfigObject ( ) ) ;
947+ } ) ;
948+
949+ it ( 'should throw error for invalid string objectKeyByteLimit override' , ( ) => {
950+ setEnv ( 'OVERRIDE_OBJECT_KEY_BYTE_LIMIT' , 'invalid' ) ;
951+ assert . throws ( ( ) => new ConfigObject ( ) ) ;
952+ } ) ;
953+ } ) ;
925954} ) ;
0 commit comments