From a6be927a1f2b72cd2669a05f53856797bc419f91 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Fri, 17 Aug 2018 09:29:00 +0200 Subject: [PATCH] small refactor --- .../methods/order/specs/isEditable.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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')); });