mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
chore: Clean up some code (#12287)
This commit is contained in:
@@ -633,6 +633,7 @@ describe('JsTaskRunner', () => {
|
||||
),
|
||||
});
|
||||
|
||||
// Assert
|
||||
expect(rpcCallSpy).toHaveBeenCalledWith('1', group.method, group.expectedParams);
|
||||
});
|
||||
|
||||
@@ -661,26 +662,22 @@ describe('JsTaskRunner', () => {
|
||||
describe('unsupported methods', () => {
|
||||
for (const unsupportedFunction of UNSUPPORTED_HELPER_FUNCTIONS) {
|
||||
it(`should throw an error if ${unsupportedFunction} is used in runOnceForAllItems`, async () => {
|
||||
// Act
|
||||
|
||||
// Act & Assert
|
||||
await expect(
|
||||
async () =>
|
||||
await executeForAllItems({
|
||||
code: `${unsupportedFunction}()`,
|
||||
inputItems,
|
||||
}),
|
||||
executeForAllItems({
|
||||
code: `${unsupportedFunction}()`,
|
||||
inputItems,
|
||||
}),
|
||||
).rejects.toThrow(UnsupportedFunctionError);
|
||||
});
|
||||
|
||||
it(`should throw an error if ${unsupportedFunction} is used in runOnceForEachItem`, async () => {
|
||||
// Act
|
||||
|
||||
// Act & Assert
|
||||
await expect(
|
||||
async () =>
|
||||
await executeForEachItem({
|
||||
code: `${unsupportedFunction}()`,
|
||||
inputItems,
|
||||
}),
|
||||
executeForEachItem({
|
||||
code: `${unsupportedFunction}()`,
|
||||
inputItems,
|
||||
}),
|
||||
).rejects.toThrow(UnsupportedFunctionError);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ import { createRequireResolver } from './require-resolver';
|
||||
import { validateRunForAllItemsOutput, validateRunForEachItemOutput } from './result-validation';
|
||||
import { DataRequestResponseReconstruct } from '../data-request/data-request-response-reconstruct';
|
||||
|
||||
export interface RPCCallObject {
|
||||
[name: string]: ((...args: unknown[]) => Promise<unknown>) | RPCCallObject;
|
||||
export interface RpcCallObject {
|
||||
[name: string]: ((...args: unknown[]) => Promise<unknown>) | RpcCallObject;
|
||||
}
|
||||
|
||||
export interface JSExecSettings {
|
||||
@@ -449,7 +449,7 @@ export class JsTaskRunner extends TaskRunner {
|
||||
}
|
||||
|
||||
private buildRpcCallObject(taskId: string) {
|
||||
const rpcObject: RPCCallObject = {};
|
||||
const rpcObject: RpcCallObject = {};
|
||||
|
||||
for (const rpcMethod of EXPOSED_RPC_METHODS) {
|
||||
set(
|
||||
|
||||
Reference in New Issue
Block a user