Skip to content

Commit

Permalink
style(MongoMemoryServer): log instance started log after assigning port
Browse files Browse the repository at this point in the history
so that the port is shown in the message
  • Loading branch information
hasezoey committed Oct 19, 2023
1 parent 8ed1bbd commit 4a5eacc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mongodb-memory-server-core/src/MongoMemoryServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,16 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
this.debug(`_startUpInstance: Creating new MongoDB instance with options:`, mongodOptions);

const instance = await MongoInstance.create(mongodOptions);
this.debug(`_startUpInstance: Instance Started, createAuth: "${createAuth}"`);

this._instanceInfo = {
...data,
dbPath: data.dbPath as string, // because otherwise the types would be incompatible
instance,
};

// log after "_instanceInfo" is set so that the port shows up in the message
this.debug(`_startUpInstance: Instance Started, createAuth: "${createAuth}"`);

// always set the "extraConnectionOptions" when "auth" is enabled, regardless of if "createAuth" gets run
if (
this.authObjectEnable() &&
Expand Down

0 comments on commit 4a5eacc

Please sign in to comment.