Skip to content

Commit ee781fc

Browse files
added more tests to comply w kickoff - no docker tests still
1 parent 7fcb95e commit ee781fc

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/cmap/connect.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export async function prepareHandshakeDocument(
201201
const compressors = options.compressors ? options.compressors : [];
202202
const { serverApi } = authContext.connection;
203203
const clientMetadata = await addContainerMetadata(options.metadata);
204+
204205
const handshakeDoc: HandshakeDocument = {
205206
[serverApi?.version || options.loadBalanced === true ? 'hello' : LEGACY_HELLO_COMMAND]: 1,
206207
helloOk: true,

test/unit/cmap/connect.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,23 @@ describe('Connect Tests', async function () {
205205
const handshakeDocument = await prepareHandshakeDocument(authContext);
206206
expect(handshakeDocument.client.env.container.orchestrator).to.equal('kubernetes');
207207
});
208+
209+
it(`should not have 'name' property in client.env `, async () => {
210+
const handshakeDocument = await prepareHandshakeDocument(authContext);
211+
expect(handshakeDocument.client.env).to.not.have.property('name');
212+
});
213+
});
214+
});
215+
216+
context('when container nor FAAS env is not present', async () => {
217+
const authContext = {
218+
connection: {},
219+
options: { ...CONNECT_DEFAULTS }
220+
};
221+
222+
it(`should not have 'env' property in client`, async () => {
223+
const handshakeDocument = await prepareHandshakeDocument(authContext);
224+
expect(handshakeDocument.client).to.not.have.property('env');
208225
});
209226
});
210227

0 commit comments

Comments
 (0)