const getDebt = require('../getDebt'); describe('client getDebt()', () => { it('should call the getDebt method', done => { let clientFk = 109; let self = jasmine.createSpyObj('self', ['remoteMethod', 'rawSql']); self.rawSql.and.returnValue(Promise.resolve([{debt: 100}])); getDebt(self); self.getDebt(clientFk) .then(result => { expect(result.debt).toEqual(100); done(); }); }); });