4 Commits

Author SHA1 Message Date
a01755fb9e 2.0.3 2022-06-03 17:31:05 +02:00
3ebf34ee9d fix(core): update 2022-06-03 17:31:04 +02:00
b71a238a3d 2.0.2 2022-05-19 08:48:43 +02:00
d0c7a95e16 fix(core): update 2022-05-19 08:48:43 +02:00
4 changed files with 636 additions and 799 deletions

1401
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartmongo", "name": "@pushrocks/smartmongo",
"version": "2.0.1", "version": "2.0.3",
"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",
@@ -10,19 +10,19 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.61", "@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbundle": "^2.0.3", "@gitzone/tsbundle": "^2.0.5",
"@gitzone/tstest": "^1.0.71", "@gitzone/tstest": "^1.0.71",
"@pushrocks/tapbundle": "^5.0.3", "@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^17.0.34" "@types/node": "^17.0.39"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartdata": "^4.0.27", "@pushrocks/smartdata": "^5.0.3",
"@pushrocks/smartpromise": "^3.1.7", "@pushrocks/smartpromise": "^3.1.7",
"mongodb-memory-server": "^8.5.2" "mongodb-memory-server": "^8.6.0"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartmongo', name: '@pushrocks/smartmongo',
version: '2.0.1', version: '2.0.3',
description: 'create a local mongodb for testing' description: 'create a local mongodb for testing'
} }

View File

@@ -14,13 +14,17 @@ export class SmartMongo {
public readyPromise = this._readyDeferred.promise; public readyPromise = this._readyDeferred.promise;
public mongoReplicaSet: plugins.mongoPlugin.MongoMemoryReplSet; public mongoReplicaSet: plugins.mongoPlugin.MongoMemoryReplSet;
constructor() { constructor() {}
}
public async start(countArg: number = 1) { public async start(countArg: number = 1) {
this.mongoReplicaSet = await plugins.mongoPlugin.MongoMemoryReplSet.create({ replSet: { count: countArg }, instanceOpts: [{ this.mongoReplicaSet = await plugins.mongoPlugin.MongoMemoryReplSet.create({
storageEngine: 'wiredTiger' replSet: { count: countArg },
}]}); instanceOpts: [
{
storageEngine: 'wiredTiger',
},
],
});
this._readyDeferred.resolve(); this._readyDeferred.resolve();
console.log(`mongoReplicaSet with ${countArg} replicas started.`); console.log(`mongoReplicaSet with ${countArg} replicas started.`);
console.log(`@pushrocks/smartmongo version ${commitinfo.version}`); console.log(`@pushrocks/smartmongo version ${commitinfo.version}`);
@@ -30,10 +34,10 @@ export class SmartMongo {
await this.readyPromise; await this.readyPromise;
return { return {
mongoDbUrl: this.mongoReplicaSet.getUri(), mongoDbUrl: this.mongoReplicaSet.getUri(),
} };
} }
public async stop() { public async stop() {
await this.mongoReplicaSet.stop(true); await this.mongoReplicaSet.stop(true);
} }
} }