@@ -12,11 +12,6 @@ import {
1212 makeClientMetadata
1313} from '../../../../src/cmap/handshake/client_metadata' ;
1414import { MongoInvalidArgumentError } from '../../../../src/error' ;
15- import { Runtime } from '../../../../src' ;
16-
17- const runtime : Runtime = {
18- os : require ( 'os' )
19- } ;
2015
2116describe ( 'client metadata module' , ( ) => {
2217 afterEach ( ( ) => sinon . restore ( ) ) ;
@@ -169,7 +164,9 @@ describe('client metadata module', () => {
169164
170165 context ( 'when driverInfo.platform is provided' , ( ) => {
171166 it ( 'throws an error if driverInfo.platform is too large' , async ( ) => {
172- const error = await makeClientMetadata ( [ { platform : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch ( e => e ) ;
167+ const error = await makeClientMetadata ( [ { platform : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch (
168+ e => e
169+ ) ;
173170 expect ( error )
174171 . to . be . instanceOf ( MongoInvalidArgumentError )
175172 . to . match ( / p l a t f o r m / ) ;
@@ -195,7 +192,9 @@ describe('client metadata module', () => {
195192
196193 context ( 'when driverInfo.name is provided' , ( ) => {
197194 it ( 'throws an error if driverInfo.name is too large' , async ( ) => {
198- const error = await makeClientMetadata ( [ { name : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch ( e => e ) ;
195+ const error = await makeClientMetadata ( [ { name : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch (
196+ e => e
197+ ) ;
199198 expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) . to . match ( / n a m e / ) ;
200199 } ) ;
201200
@@ -219,7 +218,9 @@ describe('client metadata module', () => {
219218
220219 context ( 'when driverInfo.version is provided' , ( ) => {
221220 it ( 'throws an error if driverInfo.version is too large' , async ( ) => {
222- const error = await makeClientMetadata ( [ { version : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch ( e => e ) ;
221+ const error = await makeClientMetadata ( [ { version : 'a' . repeat ( 512 ) } ] , { runtime } ) . catch (
222+ e => e
223+ ) ;
223224 expect ( error )
224225 . to . be . instanceOf ( MongoInvalidArgumentError )
225226 . to . match ( / v e r s i o n / ) ;
@@ -540,7 +541,9 @@ describe('client metadata module', () => {
540541 } ) ;
541542
542543 it ( 'does not attach it to the metadata' , async ( ) => {
543- expect ( await makeClientMetadata ( [ ] , { runtime } ) ) . not . to . have . nested . property ( 'aws.memory_mb' ) ;
544+ expect ( await makeClientMetadata ( [ ] , { runtime } ) ) . not . to . have . nested . property (
545+ 'aws.memory_mb'
546+ ) ;
544547 } ) ;
545548 } ) ;
546549 } ) ;
0 commit comments