@@ -264,21 +264,11 @@ describe('Client Metadata Update Prose Tests', function () {
264
264
client . appendMetadata ( { name, version, platform } ) ;
265
265
await client . db ( 'test' ) . command ( { ping : 1 } ) ;
266
266
267
- expect ( updatedClientMetadata . driver . name ) . to . equal (
268
- name
269
- ? `${ initialClientMetadata . driver . name } |${ name } `
270
- : initialClientMetadata . driver . name
271
- ) ;
272
- expect ( updatedClientMetadata . driver . version ) . to . equal (
273
- version
274
- ? `${ initialClientMetadata . driver . version } |${ version } `
275
- : initialClientMetadata . driver . version
276
- ) ;
277
- expect ( updatedClientMetadata . platform ) . to . equal (
278
- platform
279
- ? `${ initialClientMetadata . platform } |${ platform } `
280
- : initialClientMetadata . platform
281
- ) ;
267
+ // Since we have our own driver metadata getting added, we really want to just
268
+ // assert that the last driver info values are appended at the end.
269
+ expect ( updatedClientMetadata . driver . name . endsWith ( 'library' ) ) . to . be . true ;
270
+ expect ( updatedClientMetadata . driver . version . endsWith ( '1.2' ) ) . to . be . true ;
271
+ expect ( updatedClientMetadata . platform . endsWith ( 'Library Platform' ) ) . to . be . true ;
282
272
// - All other subfields in the client document remain unchanged from initialClientMetadata.
283
273
// (Note os is the only one getting set in these tests)
284
274
expect ( updatedClientMetadata . os ) . to . deep . equal ( initialClientMetadata . os ) ;
@@ -342,21 +332,11 @@ describe('Client Metadata Update Prose Tests', function () {
342
332
client . appendMetadata ( { name, version, platform } ) ;
343
333
await client . db ( 'test' ) . command ( { ping : 1 } ) ;
344
334
345
- expect ( updatedClientMetadata . driver . name ) . to . equal (
346
- name
347
- ? `${ initialClientMetadata . driver . name } |${ name } `
348
- : initialClientMetadata . driver . name
349
- ) ;
350
- expect ( updatedClientMetadata . driver . version ) . to . equal (
351
- version
352
- ? `${ initialClientMetadata . driver . version } |${ version } `
353
- : initialClientMetadata . driver . version
354
- ) ;
355
- expect ( updatedClientMetadata . platform ) . to . equal (
356
- platform
357
- ? `${ initialClientMetadata . platform } |${ platform } `
358
- : initialClientMetadata . platform
359
- ) ;
335
+ // Since we have our own driver metadata getting added, we really want to just
336
+ // assert that the last driver info values are appended at the end.
337
+ expect ( updatedClientMetadata . driver . name . endsWith ( 'library' ) ) . to . be . true ;
338
+ expect ( updatedClientMetadata . driver . version . endsWith ( '1.2' ) ) . to . be . true ;
339
+ expect ( updatedClientMetadata . platform . endsWith ( 'Library Platform' ) ) . to . be . true ;
360
340
// - All other subfields in the client document remain unchanged from initialClientMetadata.
361
341
// (Note os is the only one getting set in these tests)
362
342
expect ( updatedClientMetadata . os ) . to . deep . equal ( initialClientMetadata . os ) ;
0 commit comments