mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
fix: Remove unnecessary console message (no-changelog) (#4848)
* refactor: Remove unnecessary console message (no-changelog) * fix: Broken test now passing
This commit is contained in:
parent
0bd13c7173
commit
2ad62bcd44
|
@ -52,7 +52,6 @@ export async function workflowExecutionCompleted(
|
||||||
// Send the metrics
|
// Send the metrics
|
||||||
await InternalHooksManager.getInstance().onFirstProductionWorkflowSuccess(metrics);
|
await InternalHooksManager.getInstance().onFirstProductionWorkflowSuccess(metrics);
|
||||||
} catch (error) {
|
} 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
|
// 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(
|
await Db.collections.WorkflowStatistics.update(
|
||||||
{ workflowId, name },
|
{ workflowId, name },
|
||||||
|
|
|
@ -132,7 +132,6 @@ describe('Events', () => {
|
||||||
|
|
||||||
test('should not send metrics for updated entries', async () => {
|
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
|
// 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 = {
|
const workflow = {
|
||||||
id: '-1',
|
id: '-1',
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -148,9 +147,7 @@ describe('Events', () => {
|
||||||
mode: 'internal' as WorkflowExecuteMode,
|
mode: 'internal' as WorkflowExecuteMode,
|
||||||
startedAt: new Date(),
|
startedAt: new Date(),
|
||||||
};
|
};
|
||||||
mockedError.mockClear();
|
|
||||||
await workflowExecutionCompleted(workflow, runData);
|
await workflowExecutionCompleted(workflow, runData);
|
||||||
expect(mockedError).toBeCalled();
|
|
||||||
expect(mockedFirstProductionWorkflowSuccess).toBeCalledTimes(0);
|
expect(mockedFirstProductionWorkflowSuccess).toBeCalledTimes(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue