mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Remove event bus channel (no-changelog) (#9663)
This commit is contained in:
@@ -15,7 +15,6 @@ import { InternalHooks } from '@/InternalHooks';
|
||||
import { PostHogClient } from '@/posthog';
|
||||
import { RedisService } from '@/services/redis.service';
|
||||
import { OrchestrationHandlerWorkerService } from '@/services/orchestration/worker/orchestration.handler.worker.service';
|
||||
import { OrchestrationWorkerService } from '@/services/orchestration/worker/orchestration.worker.service';
|
||||
import { OrchestrationService } from '@/services/orchestration.service';
|
||||
|
||||
import * as testDb from '../shared/testDb';
|
||||
@@ -23,6 +22,8 @@ import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
const oclifConfig = new Config({ root: __dirname });
|
||||
|
||||
let eventBus: MessageEventBus;
|
||||
|
||||
beforeAll(async () => {
|
||||
config.set('executions.mode', 'queue');
|
||||
config.set('binaryDataManager.availableModes', 'filesystem');
|
||||
@@ -32,7 +33,7 @@ beforeAll(async () => {
|
||||
mockInstance(CacheService);
|
||||
mockInstance(ExternalSecretsManager);
|
||||
mockInstance(BinaryDataService);
|
||||
mockInstance(MessageEventBus);
|
||||
eventBus = mockInstance(MessageEventBus);
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
mockInstance(CredentialTypes);
|
||||
mockInstance(NodeTypes);
|
||||
@@ -58,9 +59,7 @@ test('worker initializes all its components', async () => {
|
||||
jest.spyOn(worker, 'initExternalSecrets').mockImplementation(async () => {});
|
||||
jest.spyOn(worker, 'initEventBus').mockImplementation(async () => {});
|
||||
jest.spyOn(worker, 'initOrchestration');
|
||||
jest
|
||||
.spyOn(OrchestrationWorkerService.prototype, 'publishToEventLog')
|
||||
.mockImplementation(async () => {});
|
||||
// jest.spyOn(MessageEventBus.prototype, 'send').mockImplementation(async () => {});
|
||||
jest
|
||||
.spyOn(OrchestrationHandlerWorkerService.prototype, 'initSubscriber')
|
||||
.mockImplementation(async () => {});
|
||||
@@ -79,7 +78,7 @@ test('worker initializes all its components', async () => {
|
||||
expect(worker.initEventBus).toHaveBeenCalledTimes(1);
|
||||
expect(worker.initOrchestration).toHaveBeenCalledTimes(1);
|
||||
expect(OrchestrationHandlerWorkerService.prototype.initSubscriber).toHaveBeenCalledTimes(1);
|
||||
expect(OrchestrationWorkerService.prototype.publishToEventLog).toHaveBeenCalledTimes(1);
|
||||
expect(eventBus.send).toHaveBeenCalledTimes(1);
|
||||
expect(worker.initQueue).toHaveBeenCalledTimes(1);
|
||||
|
||||
jest.restoreAllMocks();
|
||||
|
||||
Reference in New Issue
Block a user