1- 'use strict' ;
1+ import { expect } from 'chai' ;
2+ import * as sinon from 'sinon' ;
23
3- const { expect } = require ( 'chai' ) ;
4- const sinon = require ( 'sinon' ) ;
5- const { Topology } = require ( '../../../src/sdam/topology' ) ;
4+ import { Topology } from '../../../src/sdam/topology' ;
65
76describe ( 'URI' , function ( ) {
87 let client ;
@@ -21,20 +20,18 @@ describe('URI', function () {
2120 metadata : { requires : { topology : 'single' } } ,
2221
2322 test : async function ( ) {
24- var self = this ;
25-
2623 const authInformation = process . env . AUTH === 'auth' ? 'bob:pwd123@' : '' ;
2724 // Connect using the connection string
2825 const client = this . configuration . newClient (
2926 `mongodb://${ authInformation } localhost:27017/?w=0`
3027 ) ;
3128
3229 await client . connect ( ) ;
33- var db = client . db ( self . configuration . db ) ;
30+ const db = client . db ( this . configuration . db ) ;
3431
3532 const result = await db
3633 . collection ( 'mongoclient_test' )
37- . update ( { a : 1 } , { $set : { b : 1 } } , { upsert : true } ) ;
34+ . updateOne ( { a : 1 } , { $set : { b : 1 } } , { upsert : true } ) ;
3835
3936 expect ( result ) . to . exist ;
4037 expect ( result ) . property ( 'acknowledged' ) . to . be . false ;
@@ -66,7 +63,7 @@ describe('URI', function () {
6663 test : async function ( ) {
6764 const client = this . configuration . newClient ( 'mongodb://127.0.0.1:27017/?fsync=true' ) ;
6865 await client . connect ( ) ;
69- var db = client . db ( this . configuration . db ) ;
66+ const db = client . db ( this . configuration . db ) ;
7067 expect ( db . writeConcern . journal ) . to . be . true ;
7168 await client . close ( ) ;
7269 }
@@ -124,7 +121,7 @@ describe('URI', function () {
124121 expect ( options . credentials . mechanism ) . to . eql ( 'MONGODB-X509' ) ;
125122
126123 connectStub . restore ( ) ;
127- return ;
124+ return undefined ;
128125 }
129126
130127 const topologyPrototype = Topology . prototype ;
0 commit comments