From c6880d4e5d8fec1b8fd3489e94b56a625d930a2e Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 13 Feb 2020 14:29:09 -0800 Subject: [PATCH] fix(auth tests): removing alternate error handlers in tests --- test/a01-auth.spec.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/test/a01-auth.spec.js b/test/a01-auth.spec.js index 02f22b5..2c1c14e 100644 --- a/test/a01-auth.spec.js +++ b/test/a01-auth.spec.js @@ -45,18 +45,13 @@ describe('Auth', () => { console.log(`result stringified: ${JSON.stringify(result.data, null, 2)}`) assert(false, 'Unexpected result') } catch (err) { - if (err.response.status === 422) { - assert(err.response.status === 422, 'Error code 422 expected.') - } else if (err.response.status === 401) { + if (err.response.status === 401) { assert(err.response.status === 401, 'Error code 401 expected.') - } else { - console.error('Error: ', err) - console.log('Error stringified: ' + JSON.stringify(err, null, 2)) - throw err } } }) - it('should throw 422 if email is wrong format', async () => { + + it('should throw 401 if email is wrong format', async () => { try { const options = { method: 'post', @@ -70,14 +65,8 @@ describe('Auth', () => { await axios(options) assert(false, 'Unexpected result') } catch (err) { - if (err.response.status === 422) { - assert(err.response.status === 422, 'Error code 422 expected.') - } else if (err.response.status === 401) { + if (err.response.status === 401) { assert(err.response.status === 401, 'Error code 401 expected.') - } else { - console.error('Error: ', err) - console.log('Error stringified: ' + JSON.stringify(err, null, 2)) - throw err } } })