From f8736bc59962a99f067ece293990807dee821b14 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 23 Jan 2018 09:33:23 +0100 Subject: [PATCH] total greuge backend unit test error handling added --- .../client/common/methods/greuge/specs/totalGreuge.spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/client/common/methods/greuge/specs/totalGreuge.spec.js b/services/client/common/methods/greuge/specs/totalGreuge.spec.js index 1acd6792b..3a985fdce 100644 --- a/services/client/common/methods/greuge/specs/totalGreuge.spec.js +++ b/services/client/common/methods/greuge/specs/totalGreuge.spec.js @@ -1,4 +1,5 @@ import totalGreuge from '../totalGreuge'; +import {catchErrors} from '../../../../../../services/utils/jasmineHelpers'; describe('Greuge totalGreuge()', () => { it('should call the sumAmount method', done => { @@ -7,7 +8,9 @@ describe('Greuge totalGreuge()', () => { self.rawSql.and.returnValue(Promise.resolve([{sumAmount: 6000}])); totalGreuge(self); - let callback = (err, result) => { + let callback = (error, result) => { + if (error) return catchErrors(done)(error); + expect(result).toBe(6000); done(); };