Skip to content

Commit df878cf

Browse files
committed
chore: Clean up some code
1 parent 441d71e commit df878cf

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

packages/@n8n/task-runner/src/js-task-runner/__tests__/js-task-runner.test.ts

+11-14
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ describe('JsTaskRunner', () => {
633633
),
634634
});
635635

636+
// Assert
636637
expect(rpcCallSpy).toHaveBeenCalledWith('1', group.method, group.expectedParams);
637638
});
638639

@@ -661,26 +662,22 @@ describe('JsTaskRunner', () => {
661662
describe('unsupported methods', () => {
662663
for (const unsupportedFunction of UNSUPPORTED_HELPER_FUNCTIONS) {
663664
it(`should throw an error if ${unsupportedFunction} is used in runOnceForAllItems`, async () => {
664-
// Act
665-
665+
// Act & Assert
666666
await expect(
667-
async () =>
668-
await executeForAllItems({
669-
code: `${unsupportedFunction}()`,
670-
inputItems,
671-
}),
667+
executeForAllItems({
668+
code: `${unsupportedFunction}()`,
669+
inputItems,
670+
}),
672671
).rejects.toThrow(UnsupportedFunctionError);
673672
});
674673

675674
it(`should throw an error if ${unsupportedFunction} is used in runOnceForEachItem`, async () => {
676-
// Act
677-
675+
// Act & Assert
678676
await expect(
679-
async () =>
680-
await executeForEachItem({
681-
code: `${unsupportedFunction}()`,
682-
inputItems,
683-
}),
677+
executeForEachItem({
678+
code: `${unsupportedFunction}()`,
679+
inputItems,
680+
}),
684681
).rejects.toThrow(UnsupportedFunctionError);
685682
});
686683
}

packages/@n8n/task-runner/src/js-task-runner/js-task-runner.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ import { createRequireResolver } from './require-resolver';
4242
import { validateRunForAllItemsOutput, validateRunForEachItemOutput } from './result-validation';
4343
import { DataRequestResponseReconstruct } from '../data-request/data-request-response-reconstruct';
4444

45-
export interface RPCCallObject {
46-
[name: string]: ((...args: unknown[]) => Promise<unknown>) | RPCCallObject;
45+
export interface RpcCallObject {
46+
[name: string]: ((...args: unknown[]) => Promise<unknown>) | RpcCallObject;
4747
}
4848

4949
export interface JSExecSettings {
@@ -449,7 +449,7 @@ export class JsTaskRunner extends TaskRunner {
449449
}
450450

451451
private buildRpcCallObject(taskId: string) {
452-
const rpcObject: RPCCallObject = {};
452+
const rpcObject: RpcCallObject = {};
453453

454454
for (const rpcMethod of EXPOSED_RPC_METHODS) {
455455
set(

packages/core/test/SerializedBuffer.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const validSerializedBuffer: SerializedBuffer = {
77
data: [65, 66, 67], // Corresponds to 'ABC' in ASCII
88
};
99

10-
describe('serializedBufferToBuffer', () => {
10+
describe('toBuffer', () => {
1111
it('should convert a SerializedBuffer to a Buffer', () => {
1212
const buffer = toBuffer(validSerializedBuffer);
1313
expect(buffer).toBeInstanceOf(Buffer);
@@ -43,7 +43,7 @@ describe('isSerializedBuffer', () => {
4343
});
4444
});
4545

46-
describe('Integration: serializedBufferToBuffer and isSerializedBuffer', () => {
46+
describe('Integration: toBuffer and isSerializedBuffer', () => {
4747
it('should correctly validate and convert a SerializedBuffer', () => {
4848
if (isSerializedBuffer(validSerializedBuffer)) {
4949
const buffer = toBuffer(validSerializedBuffer);

0 commit comments

Comments
 (0)