mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: JS Task Runner not having access to Buffer (no-changelog) (#11285)
This commit is contained in:
@@ -281,6 +281,20 @@ describe('JsTaskRunner', () => {
|
||||
expect(outcome.result).toEqual([wrapIntoJson({ val: undefined })]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should allow access to Node.js Buffers', async () => {
|
||||
const outcome = await execTaskWithParams({
|
||||
task: newTaskWithSettings({
|
||||
code: 'return { val: Buffer.from("test-buffer").toString() }',
|
||||
nodeMode: 'runOnceForAllItems',
|
||||
}),
|
||||
taskData: newAllCodeTaskData(inputItems.map(wrapIntoJson), {
|
||||
envProviderState: undefined,
|
||||
}),
|
||||
});
|
||||
|
||||
expect(outcome.result).toEqual([wrapIntoJson({ val: 'test-buffer' })]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('runOnceForAllItems', () => {
|
||||
@@ -755,8 +769,6 @@ describe('JsTaskRunner', () => {
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
console.log('DONE');
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user