From b0c15471986249605679ba696e1ab738c7cb1cc9 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Mon, 30 Jun 2025 15:52:26 -0700 Subject: [PATCH] fix test failure --- .../sim/executor/handlers/function/function-handler.test.ts | 6 ++++++ apps/sim/tools/function/execute.test.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/apps/sim/executor/handlers/function/function-handler.test.ts b/apps/sim/executor/handlers/function/function-handler.test.ts index 92d2ba7d49..d61fc2ee21 100644 --- a/apps/sim/executor/handlers/function/function-handler.test.ts +++ b/apps/sim/executor/handlers/function/function-handler.test.ts @@ -77,6 +77,8 @@ describe('FunctionBlockHandler', () => { code: inputs.code, timeout: inputs.timeout, envVars: {}, + blockData: {}, + blockNameMapping: {}, _context: { workflowId: mockContext.workflowId }, } const expectedOutput: BlockOutput = { response: { result: 'Success' } } @@ -100,6 +102,8 @@ describe('FunctionBlockHandler', () => { code: expectedCode, timeout: inputs.timeout, envVars: {}, + blockData: {}, + blockNameMapping: {}, _context: { workflowId: mockContext.workflowId }, } const expectedOutput: BlockOutput = { response: { result: 'Success' } } @@ -116,6 +120,8 @@ describe('FunctionBlockHandler', () => { code: inputs.code, timeout: 5000, // Default timeout envVars: {}, + blockData: {}, + blockNameMapping: {}, _context: { workflowId: mockContext.workflowId }, } diff --git a/apps/sim/tools/function/execute.test.ts b/apps/sim/tools/function/execute.test.ts index 80e670d840..273316c1e2 100644 --- a/apps/sim/tools/function/execute.test.ts +++ b/apps/sim/tools/function/execute.test.ts @@ -50,6 +50,8 @@ describe('Function Execute Tool', () => { expect(body).toEqual({ code: 'return 42', envVars: {}, + blockData: {}, + blockNameMapping: {}, isCustomTool: false, timeout: 5000, workflowId: undefined, @@ -73,6 +75,8 @@ describe('Function Execute Tool', () => { code: 'const x = 40;\nconst y = 2;\nreturn x + y;', timeout: 10000, envVars: {}, + blockData: {}, + blockNameMapping: {}, isCustomTool: false, workflowId: undefined, }) @@ -87,6 +91,8 @@ describe('Function Execute Tool', () => { code: 'return 42', timeout: 10000, envVars: {}, + blockData: {}, + blockNameMapping: {}, isCustomTool: false, workflowId: undefined, })