Skip to content

Commit 330b23e

Browse files
committed
test: update assertions
1 parent 87994f9 commit 330b23e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,13 @@ describe('Client Metadata Update Prose Tests', function () {
266266

267267
// Since we have our own driver metadata getting added, we really want to just
268268
// assert that the last driver info values are appended at the end.
269-
expect(updatedClientMetadata.driver.name.endsWith('framework')).to.be.true;
270-
expect(updatedClientMetadata.driver.version.endsWith(version ? version : '1.2')).to.be
271-
.true;
272-
expect(updatedClientMetadata.platform.endsWith(platform ? platform : 'Library Platform'))
273-
.to.be.true;
269+
expect(updatedClientMetadata.driver.name).to.match(/^.*\|framework$/);
270+
expect(updatedClientMetadata.driver.version).to.match(
271+
new RegExp(`^.*\\|${version ? version : '1.2'}$`)
272+
);
273+
expect(updatedClientMetadata.platform).to.match(
274+
new RegExp(`^.*\\|${platform ? platform : 'Library Platform'}$`)
275+
);
274276
// - All other subfields in the client document remain unchanged from initialClientMetadata.
275277
// (Note os is the only one getting set in these tests)
276278
expect(updatedClientMetadata.os).to.deep.equal(initialClientMetadata.os);
@@ -336,11 +338,13 @@ describe('Client Metadata Update Prose Tests', function () {
336338

337339
// Since we have our own driver metadata getting added, we really want to just
338340
// assert that the last driver info values are appended at the end.
339-
expect(updatedClientMetadata.driver.name.endsWith('framework')).to.be.true;
340-
expect(updatedClientMetadata.driver.version.endsWith(version ? version : '1.2')).to.be
341-
.true;
342-
expect(updatedClientMetadata.platform.endsWith(platform ? platform : 'Library Platform'))
343-
.to.be.true;
341+
expect(updatedClientMetadata.driver.name).to.match(/^.*\|framework$/);
342+
expect(updatedClientMetadata.driver.version).to.match(
343+
new RegExp(`^.*\\|${version ? version : '1.2'}$`)
344+
);
345+
expect(updatedClientMetadata.platform).to.match(
346+
new RegExp(`^.*\\|${platform ? platform : 'Library Platform'}$`)
347+
);
344348
// - All other subfields in the client document remain unchanged from initialClientMetadata.
345349
// (Note os is the only one getting set in these tests)
346350
expect(updatedClientMetadata.os).to.deep.equal(initialClientMetadata.os);

0 commit comments

Comments
 (0)