mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671)
This also gets rid of `Db.collection`, which was another source of circular dependencies.
This commit is contained in:
committed by
GitHub
parent
37dd658dc5
commit
000e76e3b4
@@ -18,6 +18,7 @@ import {
|
||||
import { constants as fsConstants, accessSync } from 'fs';
|
||||
import type { SourceControlledFile } from '@/environments/sourceControl/types/sourceControlledFile';
|
||||
import type { SourceControlPreferences } from '@/environments/sourceControl/types/sourceControlPreferences';
|
||||
import { mockInstance } from '../shared/mocking';
|
||||
|
||||
const pushResult: SourceControlledFile[] = [
|
||||
{
|
||||
@@ -149,8 +150,11 @@ const pullResult: SourceControlledFile[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const license = mockInstance(License);
|
||||
|
||||
beforeAll(async () => {
|
||||
Container.get(License).isSourceControlLicensed = () => true;
|
||||
jest.resetAllMocks();
|
||||
license.isSourceControlLicensed.mockReturnValue(true);
|
||||
Container.get(SourceControlPreferencesService).getPreferences = () => ({
|
||||
branchName: 'main',
|
||||
connected: true,
|
||||
@@ -205,10 +209,6 @@ describe('Source Control', () => {
|
||||
expect(accessSync(gitFolder, fsConstants.F_OK)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should check if source control is licensed', async () => {
|
||||
expect(Container.get(License).isSourceControlLicensed()).toBe(true);
|
||||
});
|
||||
|
||||
it('should get repo type from url', async () => {
|
||||
expect(getRepoType('git@github.com:n8ntest/n8n_testrepo.git')).toBe('github');
|
||||
expect(getRepoType('git@gitlab.com:n8ntest/n8n_testrepo.git')).toBe('gitlab');
|
||||
|
||||
Reference in New Issue
Block a user