Skip to content

Commit fa12279

Browse files
chore: code review
Co-authored-by: Aditi Khare <[email protected]>
1 parent 6e9fd32 commit fa12279

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/mongo_client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,11 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
514514
* Connect to MongoDB using a url
515515
*
516516
* @remarks
517-
* Calling connect is optional as the first operation you preform will call connect if it's needed.
517+
* Calling `connect` is optional since the first operation you perform will call `connect` if it's needed.
518518
* `timeoutMS` specified at the client-level will bound the time any operation can take before throwing a timeout error.
519-
* However, when the operation being run is automatically connecting your MongoClient the timeoutMS will only be used for the operation portion of task.
520-
* This means the time to setup the MongoClient does not count against timeoutMS.
521-
* If you are using timeoutMS we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.
519+
* However, when the operation being run is automatically connecting your `MongoClient` the timeoutMS will only be used for the operation portion of task.
520+
* This means the time to setup the `MongoClient` does not count against `timeoutMS`.
521+
* If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.
522522
*
523523
* @see docs.mongodb.org/manual/reference/connection-string/
524524
*/
@@ -717,11 +717,11 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
717717
* Connect to MongoDB using a url
718718
*
719719
* @remarks
720-
* Calling connect is optional as the first operation you preform will call connect if it's needed.
720+
* Calling `connect` is optional since the first operation you perform will call `connect` if it's needed.
721721
* `timeoutMS` specified at the client-level will bound the time any operation can take before throwing a timeout error.
722-
* However, when the operation being run is automatically connecting your MongoClient the timeoutMS will only be used for the operation portion of task.
723-
* This means the time to setup the MongoClient does not count against timeoutMS.
724-
* If you are using timeoutMS we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.
722+
* However, when the operation being run is automatically connecting your `MongoClient` the timeoutMS will only be used for the operation portion of task.
723+
* This means the time to setup the `MongoClient` does not count against `timeoutMS`.
724+
* If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.
725725
*
726726
* @remarks
727727
* The programmatically provided options take precedence over the URI options.

test/integration/node-specific/auto_connect.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ describe('When executing an operation for the first time', () => {
824824
});
825825
});
826826

827-
describe('and CSOT is enabled', function () {
827+
describe('when CSOT is enabled', function () {
828828
let client: MongoClient;
829829

830830
beforeEach(async function () {
@@ -835,14 +835,14 @@ describe('When executing an operation for the first time', () => {
835835
await client.close();
836836
});
837837

838-
describe('and nothing is wrong', function () {
838+
describe('when nothing is wrong', function () {
839839
it('connects the client', async function () {
840840
await client.connect();
841841
expect(client).to.have.property('topology').that.is.instanceOf(Topology);
842842
});
843843
});
844844

845-
describe('and the server requires auth and ping is delayed', function () {
845+
describe('when the server requires auth and ping is delayed', function () {
846846
beforeEach(async function () {
847847
// set failpoint to delay ping
848848
// create new util client to avoid affecting the test client
@@ -856,7 +856,7 @@ describe('When executing an operation for the first time', () => {
856856
});
857857

858858
it(
859-
'takes as long as ping is delayed for and does not throw a timeout error',
859+
'client.connect() takes as long as ping is delayed for and does not throw a timeout error',
860860
{ requires: { auth: 'enabled' } },
861861
async function () {
862862
const start = performance.now();
@@ -886,7 +886,7 @@ describe('When executing an operation for the first time', () => {
886886
});
887887

888888
it(
889-
'takes as long as selectServer is delayed for and does not throw a timeout error',
889+
'client.connect() 'takes as long as selectServer is delayed for and does not throw a timeout error',
890890
{ requires: { auth: 'enabled' } },
891891
async function () {
892892
const start = performance.now();

0 commit comments

Comments
 (0)