2 Commits

Author SHA1 Message Date
601651c81a 1.0.5 2021-12-20 16:58:18 +01:00
bf31318a95 fix(core): update 2021-12-20 16:58:17 +01:00
4 changed files with 6 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartmongo",
"version": "1.0.4",
"version": "1.0.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartmongo",
"version": "1.0.4",
"version": "1.0.5",
"license": "MIT",
"dependencies": {
"@pushrocks/smartdata": "^4.0.27",

View File

@@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartmongo",
"version": "1.0.4",
"version": "1.0.5",
"private": false,
"description": "create a local mongodb for testing",
"main": "dist_ts/index.js",

View File

@@ -4,7 +4,7 @@ import * as smartmongo from '../ts/index';
let smartmongoInstance: smartmongo.SmartMongo;
tap.test('should create a mongo instance', async () => {
smartmongoInstance = await smartmongo.SmartMongo.createInstance();
smartmongoInstance = await smartmongo.SmartMongo.createAndInit();
});
tap.test('should stop the instance', async () => {

View File

@@ -2,9 +2,9 @@ import * as plugins from './smartmongo.plugins';
export class SmartMongo {
// STATIC
public static async createInstance() {
public static async createAndInit() {
const smartMongoInstance = new SmartMongo();
await smartMongoInstance.readyPromise;
await smartMongoInstance.init();
return smartMongoInstance;
}
@@ -14,7 +14,6 @@ export class SmartMongo {
public mongod: plugins.mongoPlugin.MongoMemoryServer;
constructor() {
this.init();
}
public async init() {