Skip to content

Commit 661468f

Browse files
kerollozhasezoey
andauthored
style: fix minor grammar mistakes (#756)
Co-authored-by: hasezoey <[email protected]>
1 parent f57ac28 commit 661468f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/mongodb-memory-server-core/src/MongoMemoryServer.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
227227
readonly auth?: Required<AutomaticAuth>;
228228

229229
/**
230-
* Create an Mongo-Memory-Sever Instance
230+
* Create a Mongo-Memory-Sever Instance
231231
* @param opts Mongo-Memory-Sever Options
232232
*/
233233
constructor(opts?: MongoMemoryServerOpts) {
@@ -242,7 +242,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
242242
}
243243

244244
/**
245-
* Create an Mongo-Memory-Sever Instance that can be awaited
245+
* Create a Mongo-Memory-Sever Instance that can be awaited
246246
* @param opts Mongo-Memory-Sever Options
247247
*/
248248
static async create(opts?: MongoMemoryServerOpts): Promise<MongoMemoryServer> {
@@ -328,13 +328,13 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
328328
}
329329

330330
/**
331-
* Find an new unlocked port
332-
* @param port An User defined default port
331+
* Find a new unlocked port
332+
* @param port A User defined default port
333333
*/
334334
protected async getNewPort(port?: number): Promise<number> {
335335
const newPort = await getPort({ port });
336336

337-
// only log this message if an custom port was provided
337+
// only log this message if a custom port was provided
338338
if (port != newPort && typeof port === 'number') {
339339
this.debug(`getNewPort: starting with port "${newPort}", since "${port}" was locked`);
340340
}
@@ -378,12 +378,12 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
378378
};
379379

380380
if (isNullOrUndefined(this._instanceInfo)) {
381-
// create an tmpDir instance if no "dbPath" is given
381+
// create a tmpDir instance if no "dbPath" is given
382382
if (!data.dbPath) {
383383
data.tmpDir = await createTmpDir('mongo-mem-');
384384
data.dbPath = data.tmpDir;
385385

386-
isNew = true; // just to ensure "isNew" is "true" because an new temporary directory got created
386+
isNew = true; // just to ensure "isNew" is "true" because a new temporary directory got created
387387
} else {
388388
this.debug(
389389
`getStartOptions: Checking if "${data.dbPath}}" (no new tmpDir) already has data`
@@ -404,7 +404,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
404404
enableAuth && // re-use all the checks from "enableAuth"
405405
!isNullOrUndefined(this.auth) && // needs to be re-checked because typescript complains
406406
(this.auth.force || isNew) && // check that either "isNew" or "this.auth.force" is "true"
407-
!instOpts.replSet; // dont run "createAuth" when its an replset, it will be run by the replset controller
407+
!instOpts.replSet; // dont run "createAuth" when its a replset, it will be run by the replset controller
408408

409409
return {
410410
data: data,
@@ -608,7 +608,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
608608
if (isNullOrUndefined(res)) {
609609
this.debug(`cleanup: force is true, but path "${dbPath}" dosnt exist anymore`);
610610
} else {
611-
assertion(res.isDirectory(), new Error('Defined dbPath is not an directory'));
611+
assertion(res.isDirectory(), new Error('Defined dbPath is not a directory'));
612612

613613
await removeDir(dbPath);
614614
}
@@ -655,7 +655,7 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
655655
if (state != MongoMemoryServerStates.running) {
656656
rej(
657657
new Error(
658-
`"ensureInstance" waited for "running" but got an different state: "${state}"`
658+
`"ensureInstance" waited for "running" but got a different state: "${state}"`
659659
)
660660
);
661661

@@ -697,11 +697,11 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
697697

698698
/**
699699
* Generate the Connection string used by mongodb
700-
* @param otherDb add an database into the uri (in mongodb its the auth database, in mongoose its the default database for models)
700+
* @param otherDb add a database into the uri (in mongodb its the auth database, in mongoose its the default database for models)
701701
* @param otherIp change the ip in the generated uri, default will otherwise always be "127.0.0.1"
702702
* @throws if state is not "running" (or "starting")
703-
* @throws if an server doesnt have "instanceInfo.port" defined
704-
* @returns an valid mongo URI, by the definition of https://docs.mongodb.com/manual/reference/connection-string/
703+
* @throws if a server doesnt have "instanceInfo.port" defined
704+
* @returns a valid mongo URI, by the definition of https://docs.mongodb.com/manual/reference/connection-string/
705705
*/
706706
getUri(otherDb?: string, otherIp?: string): string {
707707
this.debug('getUri:', this.state, otherDb, otherIp);

packages/mongodb-memory-server-core/src/__tests__/MongoMemoryServer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ describe('MongoMemoryServer', () => {
578578
mongoServer.emit(MongoMemoryServerEvents.stateChange, MongoMemoryServerStates.stopped);
579579

580580
expect(ensureInstancePromise).rejects.toThrow(
581-
`"ensureInstance" waited for "running" but got an different state: "${MongoMemoryServerStates.stopped}"`
581+
`"ensureInstance" waited for "running" but got a different state: "${MongoMemoryServerStates.stopped}"`
582582
);
583583
});
584584

0 commit comments

Comments
 (0)