diff --git a/services/order/common/methods/order/specs/isEditable.spec.js b/services/order/common/methods/order/specs/isEditable.spec.js index 64adeca39..f0d93c6db 100644 --- a/services/order/common/methods/order/specs/isEditable.spec.js +++ b/services/order/common/methods/order/specs/isEditable.spec.js @@ -4,22 +4,22 @@ const UserError = require('vn-loopback/common/helpers').UserError; describe('order isEditable()', () => { it('should throw an error if the order given is not editable', async() => { let error; - try { - await app.models.Order.isEditable(2); - } catch (e) { + + await app.models.Order.isEditable(2) + .catch(e => { error = e; - } + }); expect(error).toEqual(new UserError('This order is not editable')); }); it('should throw an error if the order given does not exists', async() => { let error; - try { - await app.models.Order.isEditable(99999); - } catch (e) { + + await app.models.Order.isEditable(99999) + .catch(e => { error = e; - } + }); expect(error).toEqual(new UserError('This order is not editable')); });