From 2ad62bcd442c4595daef4d02119122d9c37ab43d Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Wed, 7 Dec 2022 12:40:38 +0100 Subject: [PATCH] fix: Remove unnecessary console message (no-changelog) (#4848) * refactor: Remove unnecessary console message (no-changelog) * fix: Broken test now passing --- packages/cli/src/events/WorkflowStatistics.ts | 1 - packages/cli/test/unit/Events.test.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/packages/cli/src/events/WorkflowStatistics.ts b/packages/cli/src/events/WorkflowStatistics.ts index 02b0f441d..92853a43a 100644 --- a/packages/cli/src/events/WorkflowStatistics.ts +++ b/packages/cli/src/events/WorkflowStatistics.ts @@ -52,7 +52,6 @@ export async function workflowExecutionCompleted( // Send the metrics await InternalHooksManager.getInstance().onFirstProductionWorkflowSuccess(metrics); } catch (error) { - console.error(error); // Do we just assume it's a conflict error? If there is any other sort of error in the DB it should trigger here too await Db.collections.WorkflowStatistics.update( { workflowId, name }, diff --git a/packages/cli/test/unit/Events.test.ts b/packages/cli/test/unit/Events.test.ts index 5ac9129cb..29e2baf13 100644 --- a/packages/cli/test/unit/Events.test.ts +++ b/packages/cli/test/unit/Events.test.ts @@ -132,7 +132,6 @@ describe('Events', () => { test('should not send metrics for updated entries', async () => { // Call the function with the id that causes insert to fail, ensure update is called *and* metrics aren't sent - const mockedError = jest.spyOn(console, 'error'); const workflow = { id: '-1', name: '', @@ -148,9 +147,7 @@ describe('Events', () => { mode: 'internal' as WorkflowExecuteMode, startedAt: new Date(), }; - mockedError.mockClear(); await workflowExecutionCompleted(workflow, runData); - expect(mockedError).toBeCalled(); expect(mockedFirstProductionWorkflowSuccess).toBeCalledTimes(0); }); });