Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9414dac380 | |||
| 160e350b82 | |||
| 457de52134 | |||
| 997a662d63 | |||
| 0f81392b8e | |||
| 9c5f5ea44e |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartmongo",
|
"name": "@pushrocks/smartmongo",
|
||||||
"version": "1.0.5",
|
"version": "1.0.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartmongo",
|
"name": "@pushrocks/smartmongo",
|
||||||
"version": "1.0.5",
|
"version": "1.0.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdata": "^4.0.27",
|
"@pushrocks/smartdata": "^4.0.27",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartmongo",
|
"name": "@pushrocks/smartmongo",
|
||||||
"version": "1.0.5",
|
"version": "1.0.8",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "create a local mongodb for testing",
|
"description": "create a local mongodb for testing",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as smartmongo from '../ts/index';
|
|||||||
let smartmongoInstance: smartmongo.SmartMongo;
|
let smartmongoInstance: smartmongo.SmartMongo;
|
||||||
|
|
||||||
tap.test('should create a mongo instance', async () => {
|
tap.test('should create a mongo instance', async () => {
|
||||||
smartmongoInstance = await smartmongo.SmartMongo.createAndInit();
|
smartmongoInstance = await smartmongo.SmartMongo.createAndStart();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should stop the instance', async () => {
|
tap.test('should stop the instance', async () => {
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import * as plugins from './smartmongo.plugins';
|
|||||||
|
|
||||||
export class SmartMongo {
|
export class SmartMongo {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static async createAndInit() {
|
public static async createAndStart() {
|
||||||
const smartMongoInstance = new SmartMongo();
|
const smartMongoInstance = new SmartMongo();
|
||||||
await smartMongoInstance.init();
|
await smartMongoInstance.start();
|
||||||
return smartMongoInstance;
|
return smartMongoInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ export class SmartMongo {
|
|||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async init() {
|
public async start() {
|
||||||
this.mongod = await plugins.mongoPlugin.MongoMemoryServer.create();
|
this.mongod = await plugins.mongoPlugin.MongoMemoryServer.create();
|
||||||
this._readyDeferred.resolve();
|
this._readyDeferred.resolve();
|
||||||
console.log('mongod started');
|
console.log('mongod started');
|
||||||
@@ -30,6 +30,6 @@ export class SmartMongo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async stop() {
|
public async stop() {
|
||||||
this.mongod.stop();
|
await this.mongod.stop(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user