@quanticjs/testing 2.0.0 → 3.0.0
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.
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TestingModuleFactory = exports.createMockRedisClient = exports.createMockRepository = void 0;
|
|
4
4
|
const testing_1 = require("@nestjs/testing");
|
|
5
5
|
const cqrs_1 = require("@nestjs/cqrs");
|
|
6
|
+
const core_1 = require("@nestjs/core");
|
|
6
7
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
7
8
|
const common_1 = require("@nestjs/common");
|
|
8
|
-
const
|
|
9
|
+
const core_2 = require("@quanticjs/core");
|
|
9
10
|
const mocks_1 = require("./mocks");
|
|
10
11
|
Object.defineProperty(exports, "createMockRepository", { enumerable: true, get: function () { return mocks_1.createMockRepository; } });
|
|
11
12
|
Object.defineProperty(exports, "createMockRedisClient", { enumerable: true, get: function () { return mocks_1.createMockRedisClient; } });
|
|
@@ -16,19 +17,18 @@ class TestingModuleFactory {
|
|
|
16
17
|
provide: (0, typeorm_1.getRepositoryToken)(entity),
|
|
17
18
|
useValue: (0, mocks_1.createMockRepository)(),
|
|
18
19
|
}));
|
|
19
|
-
const mockRedis = { provide:
|
|
20
|
+
const mockRedis = { provide: core_2.REDIS_CLIENT, useValue: (0, mocks_1.createMockRedisClient)() };
|
|
20
21
|
const pipelineProviders = withPipeline
|
|
21
22
|
? [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
core_1.QuanticQueryBus,
|
|
23
|
+
core_2.LogBehavior,
|
|
24
|
+
core_2.ValidationBehavior,
|
|
25
|
+
core_2.BehaviorRegistry,
|
|
26
|
+
core_2.QuanticCommandBus,
|
|
27
|
+
core_2.QuanticQueryBus,
|
|
28
28
|
]
|
|
29
29
|
: [];
|
|
30
30
|
let builder = testing_1.Test.createTestingModule({
|
|
31
|
-
imports: [cqrs_1.CqrsModule.forRoot()],
|
|
31
|
+
imports: [cqrs_1.CqrsModule.forRoot(), ...(withPipeline ? [core_1.DiscoveryModule] : [])],
|
|
32
32
|
providers: [
|
|
33
33
|
...mockRepos,
|
|
34
34
|
mockRedis,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quanticjs/testing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Testing utilities for quanticjs — mock factories, TestingModuleFactory",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean": "rm -rf dist"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@quanticjs/core": "^
|
|
21
|
+
"@quanticjs/core": "^3.0.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@nestjs/common": "^11.0.0",
|