Skip to content

Commit

Permalink
fixed size tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB committed Mar 4, 2024
1 parent b44e631 commit 25d1b44
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/unit/cmap/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,8 @@ describe('Connect Tests', function () {

context('when 512 byte size limit is exceeded', async () => {
it(`should not 'env' property in client`, async () => {
let longAppName = '';
// make metadata = 507 bytes, so it takes up entire LimitedSizeDocument
for (let i = 0; i < 493; i++) {
longAppName += 's';
}
const longAppName = 's'.repeat(493);
const longAuthContext = {
connection: {},
options: { ...CONNECT_DEFAULTS, metadata: { appName: longAppName } }
Expand Down Expand Up @@ -264,11 +261,8 @@ describe('Connect Tests', function () {

context('when 512 byte size limit is exceeded', async () => {
it(`should not have 'container' property in client.env`, async () => {
let longAppName = '';
// make metadata = 507 bytes, so it takes up entire LimitedSizeDocument
for (let i = 0; i < 485; i++) {
longAppName += 's';
}
const longAppName = 's'.repeat(447);
const longAuthContext = {
connection: {},
options: {
Expand All @@ -280,7 +274,8 @@ describe('Connect Tests', function () {
}
};
const handshakeDocument = await prepareHandshakeDocument(longAuthContext);
expect(handshakeDocument.client).to.not.have.property('env');
expect(handshakeDocument.client.env.name).to.equal('aws.lambda');
expect(handshakeDocument.client.env).to.not.have.property('container');
});
});
});
Expand Down

0 comments on commit 25d1b44

Please sign in to comment.