fix(core): update

This commit is contained in:
Philipp Kunz 2021-06-09 14:55:55 +02:00
parent c241247845
commit 144a620f43
3 changed files with 11 additions and 0 deletions

View File

@ -213,6 +213,7 @@ tap.test('should ', async () => {})
// close the database connection // close the database connection
// ======================================= // =======================================
tap.test('should close the database connection', async (tools) => { tap.test('should close the database connection', async (tools) => {
await testDb.mongoDb.dropDatabase();
await testDb.close(); await testDb.close();
try { try {
await mongod.stop(); await mongod.stop();

View File

@ -70,6 +70,15 @@ export interface IManager {
} }
return collectionFactory.getCollection(constructor.name, dbArg); return collectionFactory.getCollection(constructor.name, dbArg);
} }
public static get manager() {
let manager: TManager;
if (managerArg['db']) {
manager = (managerArg as TManager);
} else {
manager = (managerArg as TDelayed<TManager>)();
}
return manager;
}
public get manager() { public get manager() {
let manager: TManager; let manager: TManager;
if (managerArg['db']) { if (managerArg['db']) {

View File

@ -47,6 +47,7 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
*/ */
public static collection: SmartdataCollection<any>; public static collection: SmartdataCollection<any>;
public collection: SmartdataCollection<any>; public collection: SmartdataCollection<any>;
public static manager: TManager;
public manager: TManager; public manager: TManager;
/** /**