Skip to content

Commit 4a5eacc

Browse files
committed
style(MongoMemoryServer): log instance started log after assigning port
so that the port is shown in the message
1 parent 8ed1bbd commit 4a5eacc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,16 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced {
479479
this.debug(`_startUpInstance: Creating new MongoDB instance with options:`, mongodOptions);
480480

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

484483
this._instanceInfo = {
485484
...data,
486485
dbPath: data.dbPath as string, // because otherwise the types would be incompatible
487486
instance,
488487
};
489488

489+
// log after "_instanceInfo" is set so that the port shows up in the message
490+
this.debug(`_startUpInstance: Instance Started, createAuth: "${createAuth}"`);
491+
490492
// always set the "extraConnectionOptions" when "auth" is enabled, regardless of if "createAuth" gets run
491493
if (
492494
this.authObjectEnable() &&

0 commit comments

Comments
 (0)