const getTotal = require('../get-total'); const model = { remoteMethod: () => {} }; let Loopback = require('../../../test-helpers/loopback'); Loopback.init(model); Loopback.rawSql(model); getTotal(model); describe('ticket getTotal()', () => { it('should call the getTotal method and return the response', done => { model.getTotal(1) .then(response => { expect(response).toEqual(11.55); done(); }); }); it(`should call the getTotal method and return zero if doesn't have lines`, done => { model.getTotal(13) .then(response => { expect(response).toEqual(0); done(); }); }); });