mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 17:12:03 -07:00
fix(auth tests): removing alternate error handlers in tests
This commit is contained in:
+4
-15
@@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user