refactor(core): Move integration test utils for insights (#16693)

This commit is contained in:
Iván Ovejero
2025-06-25 17:32:54 +02:00
committed by GitHub
parent a6ded1fc80
commit 7c33292483
231 changed files with 684 additions and 651 deletions

View File

@@ -1,3 +1,4 @@
import { randomName } from '@n8n/backend-test-utils';
import { InstalledPackages } from '@n8n/db';
import { InstalledNodesRepository } from '@n8n/db';
import { InstalledPackagesRepository } from '@n8n/db';
@@ -6,7 +7,6 @@ import { Container } from '@n8n/di';
import { NODE_PACKAGE_PREFIX } from '@/constants';
import { COMMUNITY_NODE_VERSION, COMMUNITY_PACKAGE_VERSION } from '../constants';
import { randomName } from '../random';
export const mockPackageName = () => NODE_PACKAGE_PREFIX + randomName();

View File

@@ -1,3 +1,4 @@
import { mockInstance } from '@n8n/backend-test-utils';
import { SettingsRepository, WorkflowEntity } from '@n8n/db';
import { Container } from '@n8n/di';
import { mock } from 'jest-mock-extended';
@@ -25,8 +26,6 @@ import { ExecutionService } from '@/executions/execution.service';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { Push } from '@/push';
import { mockInstance } from '../../../shared/mocking';
export { setupTestServer } from './test-server';
// ----------------------------------

View File

@@ -1,3 +1,5 @@
import { testDb } from '@n8n/backend-test-utils';
import { mockInstance } from '@n8n/backend-test-utils';
import type { Config } from '@oclif/core';
import { mock } from 'jest-mock-extended';
import type { Class } from 'n8n-core';
@@ -5,9 +7,6 @@ import type { Class } from 'n8n-core';
import type { BaseCommand } from '@/commands/base-command';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import { TelemetryEventRelay } from '@/events/relays/telemetry.event-relay';
import { mockInstance } from '@test/mocking';
import * as testDb from '../test-db';
mockInstance(MessageEventBus);

View File

@@ -1,6 +1,9 @@
import { LicenseState } from '@n8n/backend-common';
import { ModuleRegistry } from '@n8n/backend-common';
import { mockLogger } from '@n8n/backend-test-utils';
import { mockInstance, mockLogger } from '@n8n/backend-test-utils';
import { testModules } from '@n8n/backend-test-utils';
import { testDb } from '@n8n/backend-test-utils';
import type { APIRequest } from '@n8n/db';
import type { User } from '@n8n/db';
import { Container } from '@n8n/di';
import cookieParser from 'cookie-parser';
@@ -17,14 +20,10 @@ import { License } from '@/license';
import { rawBodyReader, bodyParser } from '@/middlewares';
import { PostHogClient } from '@/posthog';
import { Push } from '@/push';
import type { APIRequest } from '@/requests';
import { Telemetry } from '@/telemetry';
import * as testModules from '@test-integration/test-modules';
import { LicenseMocker } from '@test-integration/license';
import { mockInstance } from '../../../shared/mocking';
import { PUBLIC_API_REST_PATH_SEGMENT, REST_PATH_SEGMENT } from '../constants';
import { LicenseMocker } from '../license';
import * as testDb from '../test-db';
import type { SetupProps, TestServer } from '../types';
/**