Skip to content

Commit

Permalink
feat: add getDbName() async method
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed Feb 14, 2018
1 parent 0ad0b97 commit bbdaef8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -33,6 +33,7 @@ const mongod = new MongodbMemoryServer();
const uri = await mongod.getConnectionString();
const port = await mongod.getPort();
const dbPath = await mongod.getDbPath();
const dbName = await mongoServer.getDbName();

// some code

Expand Down
5 changes: 5 additions & 0 deletions src/MongoMemoryServer.js
Expand Up @@ -198,4 +198,9 @@ export default class MongoMemoryServer {
const { dbPath } = (await this.getInstanceData(): MongoInstanceDataT);
return dbPath;
}

async getDbName(): Promise<string> {
const { dbName } = (await this.getInstanceData(): MongoInstanceDataT);
return dbName;
}
}

0 comments on commit bbdaef8

Please sign in to comment.