mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Integrate object store as binary data manager (#7253)
Depends on: #7225 | Story: [PAY-848](https://linear.app/n8n/issue/PAY-848) This PR integrates the object store service as a new binary data manager for Enterprise.
This commit is contained in:
22
packages/core/test/utils.ts
Normal file
22
packages/core/test/utils.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Container } from 'typedi';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { Duplex } from 'stream';
|
||||
|
||||
import type { DeepPartial } from 'ts-essentials';
|
||||
|
||||
export const mockInstance = <T>(
|
||||
constructor: new (...args: unknown[]) => T,
|
||||
data: DeepPartial<T> | undefined = undefined,
|
||||
) => {
|
||||
const instance = mock<T>(data);
|
||||
Container.set(constructor, instance);
|
||||
return instance;
|
||||
};
|
||||
|
||||
export function toStream(buffer: Buffer) {
|
||||
const duplexStream = new Duplex();
|
||||
duplexStream.push(buffer);
|
||||
duplexStream.push(null);
|
||||
|
||||
return duplexStream;
|
||||
}
|
||||
Reference in New Issue
Block a user