Skip to content

Commit 618c3d0

Browse files
committed
change file from js to ts
1 parent 24c17d7 commit 618c3d0

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

test/integration/uri-options/uri.test.js renamed to test/integration/uri-options/uri.test.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
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

76
describe('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

Comments
 (0)