refactor(core): Separate license state from license service (#15097)

This commit is contained in:
Iván Ovejero
2025-05-06 09:43:08 +02:00
committed by GitHub
parent e86edf536f
commit ca0e7ffe3b
18 changed files with 365 additions and 104 deletions

View File

@@ -1,8 +1,10 @@
import { LicenseState } from '@n8n/backend-common';
import { Container } from '@n8n/di';
import { mock } from 'jest-mock-extended';
import type { AuthenticatedRequest } from '@/requests';
import { mockInstance } from '@test/mocking';
import { LicenseMocker } from '@test-integration/license';
import * as testDb from '@test-integration/test-db';
import { TypeToNumber } from '../database/entities/insights-shared';
@@ -12,6 +14,7 @@ import { InsightsController } from '../insights.controller';
// Initialize DB once for all tests
beforeAll(async () => {
await testDb.init();
new LicenseMocker().mockLicenseState(Container.get(LicenseState));
});
// Terminate DB once after all tests complete