@villedemontreal/mongo 6.7.0 → 6.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
2
|
+
// import { assert } from 'chai';
|
|
3
|
+
// import { MongoMemoryReplSet, MongoMemoryServer } from 'mongodb-memory-server-core';
|
|
4
|
+
// import { MongoUtils } from './mongoUtils';
|
|
5
|
+
// describe('MongoUtils - #mockMongoose', () => {
|
|
6
|
+
// /*
|
|
7
|
+
// It is mandatory to create a new instance of MongoUtils to test the function mockMongoose as the singleton will keep its parameters instanced if used again. The parameter mongoMemServer, if instanciated by a first call,
|
|
8
|
+
// won't be changed on a second one, as if the memory server is already mocked, nothing happens.
|
|
9
|
+
// */
|
|
10
|
+
// it('should return a mongo memory server', async function() {
|
|
11
|
+
// const mongoUtils = new MongoUtils();
|
|
12
|
+
// const memServ = await mongoUtils.mockMongoose(this, null, false);
|
|
13
|
+
// assert.isDefined(memServ);
|
|
14
|
+
// assert.instanceOf(memServ, MongoMemoryServer);
|
|
15
|
+
// });
|
|
16
|
+
// it('should return a mongo memory replica set', async function() {
|
|
17
|
+
// const mongoUtils = new MongoUtils();
|
|
18
|
+
// const memServ = await mongoUtils.mockMongoose(this, null, true);
|
|
19
|
+
// assert.isDefined(memServ);
|
|
20
|
+
// assert.instanceOf(memServ, MongoMemoryReplSet);
|
|
21
|
+
// });
|
|
22
|
+
// });
|
|
24
23
|
//# sourceMappingURL=mongoUtils.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongoUtils.test.js","sourceRoot":"","sources":["../../src/mongoUtils.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mongoUtils.test.js","sourceRoot":"","sources":["../../src/mongoUtils.test.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,sFAAsF;AACtF,6CAA6C;AAE7C,iDAAiD;AACjD,OAAO;AACP,iOAAiO;AACjO,oGAAoG;AACpG,OAAO;AACP,iEAAiE;AACjE,2CAA2C;AAC3C,wEAAwE;AACxE,iCAAiC;AACjC,qDAAqD;AACrD,QAAQ;AAER,sEAAsE;AACtE,2CAA2C;AAC3C,uEAAuE;AACvE,iCAAiC;AACjC,sDAAsD;AACtD,QAAQ;AACR,MAAM"}
|
package/package.json
CHANGED
package/src/mongoUtils.test.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { assert } from 'chai';
|
|
2
|
-
import { MongoMemoryReplSet, MongoMemoryServer } from 'mongodb-memory-server-core';
|
|
3
|
-
import { MongoUtils } from './mongoUtils';
|
|
1
|
+
// import { assert } from 'chai';
|
|
2
|
+
// import { MongoMemoryReplSet, MongoMemoryServer } from 'mongodb-memory-server-core';
|
|
3
|
+
// import { MongoUtils } from './mongoUtils';
|
|
4
4
|
|
|
5
|
-
describe('MongoUtils - #mockMongoose', () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
// describe('MongoUtils - #mockMongoose', () => {
|
|
6
|
+
// /*
|
|
7
|
+
// It is mandatory to create a new instance of MongoUtils to test the function mockMongoose as the singleton will keep its parameters instanced if used again. The parameter mongoMemServer, if instanciated by a first call,
|
|
8
|
+
// won't be changed on a second one, as if the memory server is already mocked, nothing happens.
|
|
9
|
+
// */
|
|
10
|
+
// it('should return a mongo memory server', async function() {
|
|
11
|
+
// const mongoUtils = new MongoUtils();
|
|
12
|
+
// const memServ = await mongoUtils.mockMongoose(this, null, false);
|
|
13
|
+
// assert.isDefined(memServ);
|
|
14
|
+
// assert.instanceOf(memServ, MongoMemoryServer);
|
|
15
|
+
// });
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
17
|
+
// it('should return a mongo memory replica set', async function() {
|
|
18
|
+
// const mongoUtils = new MongoUtils();
|
|
19
|
+
// const memServ = await mongoUtils.mockMongoose(this, null, true);
|
|
20
|
+
// assert.isDefined(memServ);
|
|
21
|
+
// assert.instanceOf(memServ, MongoMemoryReplSet);
|
|
22
|
+
// });
|
|
23
|
+
// });
|