diff --git a/packages/nodes-base/nodes/Transform/Summarize/test/unitTests/execute.test.ts b/packages/nodes-base/nodes/Transform/Summarize/test/unitTests/execute.test.ts index 67389cfb79..d675e4be6d 100644 --- a/packages/nodes-base/nodes/Transform/Summarize/test/unitTests/execute.test.ts +++ b/packages/nodes-base/nodes/Transform/Summarize/test/unitTests/execute.test.ts @@ -10,10 +10,7 @@ let summarizeNode: Summarize; let mockExecuteFunctions: MockProxy; describe('Test Summarize Node, execute', () => { - let nodeExecutionOutputSpy: jest.SpyInstance; beforeEach(() => { - nodeExecutionOutputSpy = jest.spyOn(NodeExecutionOutput.prototype, 'constructor' as any); - summarizeNode = new Summarize(); mockExecuteFunctions = mock({ getNode: jest.fn().mockReturnValue({ name: 'test-node' }), @@ -26,7 +23,6 @@ describe('Test Summarize Node, execute', () => { }); afterEach(() => { - nodeExecutionOutputSpy.mockRestore(); jest.clearAllMocks(); }); @@ -47,16 +43,14 @@ describe('Test Summarize Node, execute', () => { const result = await summarizeNode.execute.call(mockExecuteFunctions); - expect(result).toBeDefined(); - expect(nodeExecutionOutputSpy).toHaveBeenCalledWith( - expect.any(Array), - expect.arrayContaining([ - expect.objectContaining({ - message: expect.stringContaining('nonexistentField'), - location: 'outputPane', - }), - ]), - ); + expect(result).toBeInstanceOf(NodeExecutionOutput); + expect(result).toEqual([[{ json: { sum_nonexistentField: 0 }, pairedItem: [{ item: 0 }] }]]); + expect((result as NodeExecutionOutput).getHints()).toEqual([ + { + location: 'outputPane', + message: "The field 'nonexistentField' does not exist in any items", + }, + ]); }); it('should throw error if node version is < 1.1 and fields not found', async () => {