From df5b888aeb6731b3a6fd54f9109d49caa920fcbc Mon Sep 17 00:00:00 2001 From: hasezoey Date: Thu, 25 Nov 2021 15:04:39 +0100 Subject: [PATCH] refactor(MongoMemoryServer::stop): remove assertion for typescript types --- .../mongodb-memory-server-core/src/MongoMemoryServer.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts index 0d37dbc91..4714baa28 100644 --- a/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts +++ b/packages/mongodb-memory-server-core/src/MongoMemoryServer.ts @@ -482,13 +482,6 @@ export class MongoMemoryServer extends EventEmitter implements ManagerAdvanced { return false; } - // assert here, otherwise typescript is not happy - // TODO: remove check, typescript does not need this anymore - assertion( - !isNullOrUndefined(this._instanceInfo.instance), - new Error('"instanceInfo.instance" is undefined!') - ); - this.debug( `stop: Stopping MongoDB server on port ${this._instanceInfo.port} with pid ${this._instanceInfo.instance.mongodProcess?.pid}` // "undefined" would say more than "" );