Skip to content

Commit 25d1b44

Browse files
fixed size tests
1 parent b44e631 commit 25d1b44

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/unit/cmap/connect.test.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,8 @@ describe('Connect Tests', function () {
219219

220220
context('when 512 byte size limit is exceeded', async () => {
221221
it(`should not 'env' property in client`, async () => {
222-
let longAppName = '';
223222
// 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);
227224
const longAuthContext = {
228225
connection: {},
229226
options: { ...CONNECT_DEFAULTS, metadata: { appName: longAppName } }
@@ -264,11 +261,8 @@ describe('Connect Tests', function () {
264261

265262
context('when 512 byte size limit is exceeded', async () => {
266263
it(`should not have 'container' property in client.env`, async () => {
267-
let longAppName = '';
268264
// 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);
272266
const longAuthContext = {
273267
connection: {},
274268
options: {
@@ -280,7 +274,8 @@ describe('Connect Tests', function () {
280274
}
281275
};
282276
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');
284279
});
285280
});
286281
});

0 commit comments

Comments
 (0)