From bf31318a95b39883109d2bf2c0a86b306f27acdd Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 20 Dec 2021 16:58:17 +0100 Subject: [PATCH] fix(core): update --- test/test.ts | 2 +- ts/index.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/test.ts b/test/test.ts index eee2f0c..adbbd1e 100644 --- a/test/test.ts +++ b/test/test.ts @@ -4,7 +4,7 @@ import * as smartmongo from '../ts/index'; let smartmongoInstance: smartmongo.SmartMongo; tap.test('should create a mongo instance', async () => { - smartmongoInstance = await smartmongo.SmartMongo.createInstance(); + smartmongoInstance = await smartmongo.SmartMongo.createAndInit(); }); tap.test('should stop the instance', async () => { diff --git a/ts/index.ts b/ts/index.ts index 5e790ca..883ef3b 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -2,9 +2,9 @@ import * as plugins from './smartmongo.plugins'; export class SmartMongo { // STATIC - public static async createInstance() { + public static async createAndInit() { const smartMongoInstance = new SmartMongo(); - await smartMongoInstance.readyPromise; + await smartMongoInstance.init(); return smartMongoInstance; } @@ -14,7 +14,6 @@ export class SmartMongo { public mongod: plugins.mongoPlugin.MongoMemoryServer; constructor() { - this.init(); } public async init() {