const {models} = require('vn-loopback/server/server'); fdescribe('account changePassword()', () => { it('should throw an error when old password is wrong', async() => { // let err; const result = await models.Account.changePassword(1, 'wrongPassword', 'nightmare.9999') .catch(error => err = error.sqlMessage); expect(result).toBe(true); // expect(err).toEqual('Invalid password'); }); });