Compare commits

..

4 Commits

Author SHA1 Message Date
3f591ff9d8 4.0.22 2021-11-12 18:04:08 +01:00
7b33347b4c fix(core): update 2021-11-12 18:04:08 +01:00
3f11cbf595 4.0.21 2021-11-12 17:32:43 +01:00
cf1ec7f9eb fix(core): update 2021-11-12 17:32:43 +01:00
5 changed files with 24 additions and 28 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "4.0.20", "version": "4.0.22",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "4.0.20", "version": "4.0.22",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^5.0.0", "@pushrocks/lik": "^5.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "4.0.20", "version": "4.0.22",
"private": false, "private": false,
"description": "do more with data", "description": "do more with data",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -31,6 +31,15 @@ tap.test('should create a testinstance as database', async () => {
await testDb.init(); await testDb.init();
}); });
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,
});
await testDb.init();
});
let easyStore: smartdata.EasyStore<{ let easyStore: smartdata.EasyStore<{
key1: string; key1: string;
key2: string; key2: string;
@ -44,11 +53,8 @@ tap.test('should create an easystore', async () => {
}); });
tap.test('close', async () => { tap.test('close', async () => {
testDb.close(); await mongod.stop();
mongod.stop(); await testDb.close();
setTimeout(() => {
process.exit(0);
}, 1000);
}); });
tap.start(); tap.start();

View File

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

View File

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