total greuge backend unit test error handling added
This commit is contained in:
parent
5341c5bbf1
commit
f8736bc599
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue