mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Migrate binary-data config to a decorated config class (#14616)
This commit is contained in:
committed by
GitHub
parent
a12c9522d5
commit
2ca742cb15
@@ -1,6 +1,7 @@
|
||||
import { Container } from '@n8n/di';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import {
|
||||
BinaryDataConfig,
|
||||
BinaryDataService,
|
||||
InstanceSettings,
|
||||
UnrecognizedNodeTypeError,
|
||||
@@ -37,6 +38,7 @@ export { setupTestServer } from './test-server';
|
||||
* Initialize node types.
|
||||
*/
|
||||
export async function initActiveWorkflowManager() {
|
||||
mockInstance(BinaryDataConfig);
|
||||
mockInstance(InstanceSettings, {
|
||||
isMultiMain: false,
|
||||
});
|
||||
@@ -110,12 +112,13 @@ export async function initNodeTypes(customNodes?: INodeTypeData) {
|
||||
* Initialize a BinaryDataService for test runs.
|
||||
*/
|
||||
export async function initBinaryDataService(mode: 'default' | 'filesystem' = 'default') {
|
||||
const binaryDataService = new BinaryDataService(mock(), mock());
|
||||
await binaryDataService.init({
|
||||
const config = mock<BinaryDataConfig>({
|
||||
mode,
|
||||
availableModes: [mode],
|
||||
localStoragePath: '',
|
||||
});
|
||||
const binaryDataService = new BinaryDataService(config);
|
||||
await binaryDataService.init();
|
||||
Container.set(BinaryDataService, binaryDataService);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user