mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core)!: Make getBinaryStream async (#7247)
Story: [PAY-846](https://linear.app/n8n/issue/PAY-846) | Related: https://github.com/n8n-io/n8n/pull/7225 For the S3 backend for external storage of binary data and execution data, the `getAsStream` method in the binary data manager interface used by FS and S3 will need to become async. This is a breaking change for nodes-base.
This commit is contained in:
@@ -2,7 +2,7 @@ import { prepareRequestBody } from '../../GenericFunctions';
|
||||
import type { BodyParameter, BodyParametersReducer } from '../../GenericFunctions';
|
||||
|
||||
describe('HTTP Node Utils, prepareRequestBody', () => {
|
||||
it('should call default reducer', () => {
|
||||
it('should call default reducer', async () => {
|
||||
const bodyParameters: BodyParameter[] = [
|
||||
{
|
||||
name: 'foo.bar',
|
||||
@@ -11,15 +11,13 @@ describe('HTTP Node Utils, prepareRequestBody', () => {
|
||||
];
|
||||
const defaultReducer: BodyParametersReducer = jest.fn();
|
||||
|
||||
prepareRequestBody(bodyParameters, 'json', 3, defaultReducer);
|
||||
await prepareRequestBody(bodyParameters, 'json', 3, defaultReducer);
|
||||
|
||||
expect(defaultReducer).toBeCalledTimes(1);
|
||||
expect(defaultReducer).toBeCalledWith({}, { name: 'foo.bar', value: 'baz' }, 0, [
|
||||
{ name: 'foo.bar', value: 'baz' },
|
||||
]);
|
||||
expect(defaultReducer).toBeCalledWith({}, { name: 'foo.bar', value: 'baz' });
|
||||
});
|
||||
|
||||
it('should call process dot notations', () => {
|
||||
it('should call process dot notations', async () => {
|
||||
const bodyParameters: BodyParameter[] = [
|
||||
{
|
||||
name: 'foo.bar.spam',
|
||||
@@ -28,7 +26,7 @@ describe('HTTP Node Utils, prepareRequestBody', () => {
|
||||
];
|
||||
const defaultReducer: BodyParametersReducer = jest.fn();
|
||||
|
||||
const result = prepareRequestBody(bodyParameters, 'json', 4, defaultReducer);
|
||||
const result = await prepareRequestBody(bodyParameters, 'json', 4, defaultReducer);
|
||||
|
||||
expect(defaultReducer).toBeCalledTimes(0);
|
||||
expect(result).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user