-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
3f8765a
commit 5e730ff
Showing
4 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
test/integration/server-discovery-and-monitoring/topology_description.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { MongoClient, MongoClientOptions } from '../../../src/mongo_client'; | ||
import { getTopology } from '../../../src/utils'; | ||
|
||
describe('TopologyDescription (integration tests)', function () { | ||
let client: MongoClient; | ||
|
||
afterEach(async function () { | ||
await client.close(); | ||
}); | ||
|
||
context('options', function () { | ||
context('localThresholdMS', function () { | ||
it('should default to 15ms', async function () { | ||
const options: MongoClientOptions = {}; | ||
client = await this.configuration.newClient(options).connect(); | ||
const topologyDescription = getTopology(client).description; | ||
expect(topologyDescription).to.have.ownProperty('localThresholdMS').to.equal(15); | ||
}); | ||
|
||
it('should be set to the localThresholdMS option when it is passed in', async function () { | ||
const options: MongoClientOptions = { | ||
localThresholdMS: 30 | ||
}; | ||
client = await this.configuration.newClient(options).connect(); | ||
const topologyDescription = getTopology(client).description; | ||
expect(topologyDescription).to.have.ownProperty('localThresholdMS').to.equal(30); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters