fix(core): update

This commit is contained in:
2021-11-12 18:04:08 +01:00
parent 3f11cbf595
commit 7b33347b4c
3 changed files with 15 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ let mongod: mongoPlugin.MongoMemoryServer;
const totalCars = 2000;
tap.skip.test('should create a testinstance as database', async () => {
tap.test('should create a testinstance as database', async () => {
mongod = await mongoPlugin.MongoMemoryServer.create();
console.log('created mongod instance');
console.log('mongod started');
@@ -30,17 +30,15 @@ tap.skip.test('should create a testinstance as database', async () => {
};
console.log(smartdataOptions);
testDb = new smartdata.SmartdataDb(smartdataOptions);
await testDb.init();
});
tap.test('should connect to atlas', async (tools) => {
tap.skip.test('should connect to atlas', async (tools) => {
const databaseName = `test-smartdata-${smartunique.shortId()}`;
testDb = new smartdata.SmartdataDb({
mongoDbUrl: testQenv.getEnvVarOnDemand('MONGO_URL'),
mongoDbName: databaseName,
});
});
tap.test('should establish a connection to mongod', async () => {
await testDb.init();
});
@@ -94,12 +92,9 @@ tap.test('should get a car', async () => {
// =======================================
// close the database connection
// =======================================
tap.test('should close the database connection', async (tools) => {
await testDb.mongoDb.dropDatabase();
tap.test('close', async () => {
await mongod.stop();
await testDb.close();
try {
await mongod.stop();
} catch (e) {}
});
tap.start({ throwOnError: true });