fix(core): update

This commit is contained in:
2021-11-12 18:12:59 +01:00
parent 3f591ff9d8
commit 42aa9f9f8a
3 changed files with 21 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ let mongod: mongoPlugin.MongoMemoryServer;
const totalCars = 2000;
tap.test('should create a testinstance as database', async () => {
tap.skip.test('should create a testinstance as database', async () => {
mongod = await mongoPlugin.MongoMemoryServer.create();
console.log('created mongod instance');
console.log('mongod started');
@@ -33,7 +33,7 @@ tap.test('should create a testinstance as database', async () => {
await testDb.init();
});
tap.skip.test('should connect to atlas', async (tools) => {
tap.test('should connect to atlas', async (tools) => {
const databaseName = `test-smartdata-${smartunique.shortId()}`;
testDb = new smartdata.SmartdataDb({
mongoDbUrl: testQenv.getEnvVarOnDemand('MONGO_URL'),
@@ -211,7 +211,11 @@ tap.test('should use a cursor', async () => {
// close the database connection
// =======================================
tap.test('close', async () => {
await mongod.stop();
if (mongod) {
await mongod.stop();
} else {
await testDb.mongoDb.dropDatabase();
}
await testDb.close();
});