@tsed/bullmq 7.45.0 → 7.47.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.
- package/jest.config.js +1 -1
- package/lib/cjs/BullMQModule.js +3 -0
- package/lib/cjs/BullMQModule.js.map +1 -1
- package/lib/esm/BullMQModule.js +3 -0
- package/lib/esm/BullMQModule.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/BullMQModule.spec.ts +22 -2
- package/src/BullMQModule.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/bullmq",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.47.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "BullMQ integration for Ts.ED",
|
|
6
6
|
"keywords": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"tslib": "2.5.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tsed/common": "7.
|
|
33
|
-
"@tsed/core": "7.
|
|
34
|
-
"@tsed/di": "7.
|
|
32
|
+
"@tsed/common": "7.47.0",
|
|
33
|
+
"@tsed/core": "7.47.0",
|
|
34
|
+
"@tsed/di": "7.47.0",
|
|
35
35
|
"@tsed/eslint": "7.44.1",
|
|
36
|
-
"@tsed/schema": "7.
|
|
36
|
+
"@tsed/schema": "7.47.0",
|
|
37
37
|
"@tsed/typescript": "7.44.1",
|
|
38
38
|
"bullmq": "^4.12.3",
|
|
39
39
|
"eslint": "^8.12.0",
|
package/src/BullMQModule.spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {PlatformTest} from "@tsed/common";
|
|
1
|
+
import {InjectorService, PlatformTest} from "@tsed/common";
|
|
2
2
|
import {catchAsyncError} from "@tsed/core";
|
|
3
3
|
import {Queue, Worker} from "bullmq";
|
|
4
|
-
import {instance, mock, verify, when} from "ts-mockito";
|
|
4
|
+
import {anyString, anything, instance, mock, verify, when} from "ts-mockito";
|
|
5
5
|
|
|
6
6
|
import "./BullMQModule";
|
|
7
7
|
import {BullMQModule} from "./BullMQModule";
|
|
@@ -182,3 +182,23 @@ describe("module", () => {
|
|
|
182
182
|
});
|
|
183
183
|
});
|
|
184
184
|
});
|
|
185
|
+
|
|
186
|
+
it('skips initialization when no config is provided', async () => {
|
|
187
|
+
const injector = mock(InjectorService)
|
|
188
|
+
const dispatcher = mock(JobDispatcher);
|
|
189
|
+
await PlatformTest.create({
|
|
190
|
+
imports: [
|
|
191
|
+
{
|
|
192
|
+
token: InjectorService,
|
|
193
|
+
use: instance(injector),
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
token: JobDispatcher,
|
|
197
|
+
use: instance(dispatcher)
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
verify(injector.add(anyString(), anything())).never();
|
|
203
|
+
verify(dispatcher.dispatch(anything())).never()
|
|
204
|
+
});
|
package/src/BullMQModule.ts
CHANGED
|
@@ -15,6 +15,10 @@ export class BullMQModule implements BeforeInit {
|
|
|
15
15
|
constructor(private readonly injector: InjectorService, private readonly dispatcher: JobDispatcher) {}
|
|
16
16
|
|
|
17
17
|
$beforeInit() {
|
|
18
|
+
if (!this.bullmq) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
this.buildWorkers();
|
|
19
23
|
this.buildQueues();
|
|
20
24
|
|