mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Only send needed data to task runner (no-changelog) (#11487)
This commit is contained in:
@@ -26,6 +26,7 @@ const getProxyFromFixture = (
|
||||
run: IRun | null,
|
||||
activeNode: string,
|
||||
mode?: WorkflowExecuteMode,
|
||||
opts?: { throwOnMissingExecutionData: boolean },
|
||||
) => {
|
||||
const taskData = run?.data.resultData.runData[activeNode]?.[0];
|
||||
const lastNodeConnectionInputData = taskData?.data?.main[0];
|
||||
@@ -73,7 +74,7 @@ const getProxyFromFixture = (
|
||||
executeData,
|
||||
);
|
||||
|
||||
return dataProxy.getDataProxy();
|
||||
return dataProxy.getDataProxy(opts);
|
||||
};
|
||||
|
||||
describe('WorkflowDataProxy', () => {
|
||||
@@ -404,4 +405,42 @@ describe('WorkflowDataProxy', () => {
|
||||
expect(proxy.$node.PinnedSet.json.firstName).toBe('Joe');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Partial data', () => {
|
||||
const fixture = loadFixture('partial_data');
|
||||
|
||||
describe('Default behaviour (throw on missing execution data)', () => {
|
||||
const proxy = getProxyFromFixture(fixture.workflow, fixture.run, 'End');
|
||||
|
||||
test('$binary', () => {
|
||||
expect(() => proxy.$binary).toThrowError(ExpressionError);
|
||||
});
|
||||
|
||||
test('$json', () => {
|
||||
expect(() => proxy.$json).toThrowError(ExpressionError);
|
||||
});
|
||||
|
||||
test('$data', () => {
|
||||
expect(() => proxy.$data).toThrowError(ExpressionError);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Don't throw on missing execution data)", () => {
|
||||
const proxy = getProxyFromFixture(fixture.workflow, fixture.run, 'End', undefined, {
|
||||
throwOnMissingExecutionData: false,
|
||||
});
|
||||
|
||||
test('$binary', () => {
|
||||
expect(proxy.$binary).toBeUndefined();
|
||||
});
|
||||
|
||||
test('$json', () => {
|
||||
expect(proxy.$json).toBeUndefined();
|
||||
});
|
||||
|
||||
test('$data', () => {
|
||||
expect(proxy.$data).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user