mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
refactor(core): Migrate DB setup to use DI (#15324)
This commit is contained in:
committed by
GitHub
parent
c061acc01c
commit
8591c2e0d1
@@ -7,6 +7,7 @@ import { mock } from 'jest-mock-extended';
|
||||
import type { IRun } from 'n8n-workflow';
|
||||
|
||||
import { ActiveExecutions } from '@/active-executions';
|
||||
import { DbConnection } from '@/databases/db-connection';
|
||||
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
|
||||
import { DeprecationService } from '@/deprecation/deprecation.service';
|
||||
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
|
||||
@@ -35,12 +36,9 @@ const posthogClient = mockInstance(PostHogClient);
|
||||
const telemetryEventRelay = mockInstance(TelemetryEventRelay);
|
||||
const externalHooks = mockInstance(ExternalHooks);
|
||||
|
||||
jest.mock('@/db', () => ({
|
||||
init: jest.fn().mockResolvedValue(undefined),
|
||||
migrate: jest.fn().mockResolvedValue(undefined),
|
||||
connectionState: { connected: false },
|
||||
close: jest.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
const dbConnection = mockInstance(DbConnection);
|
||||
dbConnection.init.mockResolvedValue(undefined);
|
||||
dbConnection.migrate.mockResolvedValue(undefined);
|
||||
|
||||
test('should start a task runner when task runners are enabled', async () => {
|
||||
// arrange
|
||||
|
||||
Reference in New Issue
Block a user