Skip to content

Commit bbdaef8

Browse files
committed
feat: add getDbName() async method
1 parent 0ad0b97 commit bbdaef8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const mongod = new MongodbMemoryServer();
3333
const uri = await mongod.getConnectionString();
3434
const port = await mongod.getPort();
3535
const dbPath = await mongod.getDbPath();
36+
const dbName = await mongoServer.getDbName();
3637

3738
// some code
3839

src/MongoMemoryServer.js

+5
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,9 @@ export default class MongoMemoryServer {
198198
const { dbPath } = (await this.getInstanceData(): MongoInstanceDataT);
199199
return dbPath;
200200
}
201+
202+
async getDbName(): Promise<string> {
203+
const { dbName } = (await this.getInstanceData(): MongoInstanceDataT);
204+
return dbName;
205+
}
201206
}

0 commit comments

Comments
 (0)