mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
refactor(core): Refactor some of the external secrets related code (no-changelog) (#14791)
This commit is contained in:
committed by
GitHub
parent
e83a64b84a
commit
749f130d4f
@@ -1,8 +1,7 @@
|
||||
import { Container } from '@n8n/di';
|
||||
import { DataSource, EntityManager, type EntityMetadata } from '@n8n/typeorm';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import type { Class } from 'n8n-core';
|
||||
import type { Logger } from 'n8n-core';
|
||||
import type { Cipher, Class, Logger } from 'n8n-core';
|
||||
import type { DeepPartial } from 'ts-essentials';
|
||||
|
||||
export const mockInstance = <T>(
|
||||
@@ -25,3 +24,9 @@ export const mockEntityManager = (entityClass: Class) => {
|
||||
};
|
||||
|
||||
export const mockLogger = () => mock<Logger>({ scoped: jest.fn().mockReturnValue(mock<Logger>()) });
|
||||
|
||||
export const mockCipher = () =>
|
||||
mock<Cipher>({
|
||||
encrypt: (data) => (typeof data === 'string' ? data : JSON.stringify(data)),
|
||||
decrypt: (data) => data,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user