@@ -219,11 +219,8 @@ describe('Connect Tests', function () {
219
219
220
220
context ( 'when 512 byte size limit is exceeded' , async ( ) => {
221
221
it ( `should not 'env' property in client` , async ( ) => {
222
- let longAppName = '' ;
223
222
// make metadata = 507 bytes, so it takes up entire LimitedSizeDocument
224
- for ( let i = 0 ; i < 493 ; i ++ ) {
225
- longAppName += 's' ;
226
- }
223
+ const longAppName = 's' . repeat ( 493 ) ;
227
224
const longAuthContext = {
228
225
connection : { } ,
229
226
options : { ...CONNECT_DEFAULTS , metadata : { appName : longAppName } }
@@ -264,11 +261,8 @@ describe('Connect Tests', function () {
264
261
265
262
context ( 'when 512 byte size limit is exceeded' , async ( ) => {
266
263
it ( `should not have 'container' property in client.env` , async ( ) => {
267
- let longAppName = '' ;
268
264
// make metadata = 507 bytes, so it takes up entire LimitedSizeDocument
269
- for ( let i = 0 ; i < 485 ; i ++ ) {
270
- longAppName += 's' ;
271
- }
265
+ const longAppName = 's' . repeat ( 447 ) ;
272
266
const longAuthContext = {
273
267
connection : { } ,
274
268
options : {
@@ -280,7 +274,8 @@ describe('Connect Tests', function () {
280
274
}
281
275
} ;
282
276
const handshakeDocument = await prepareHandshakeDocument ( longAuthContext ) ;
283
- expect ( handshakeDocument . client ) . to . not . have . property ( 'env' ) ;
277
+ expect ( handshakeDocument . client . env . name ) . to . equal ( 'aws.lambda' ) ;
278
+ expect ( handshakeDocument . client . env ) . to . not . have . property ( 'container' ) ;
284
279
} ) ;
285
280
} ) ;
286
281
} ) ;
0 commit comments