mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
10 lines
398 B
JavaScript
10 lines
398 B
JavaScript
|
|
import test from 'ava'
|
||
|
|
import Client from '../../src/api/client'
|
||
|
|
|
||
|
|
test('parseErrorMessage() returns the body or status code', t => {
|
||
|
|
const client = new Client()
|
||
|
|
t.is(client.parseErrorMessage({ statusCode: 500 }, 'something went wrong'), 'something went wrong')
|
||
|
|
t.is(client.parseErrorMessage({ statusCode: 500 }, ''), '500')
|
||
|
|
t.is(client.parseErrorMessage({ statusCode: 404 }, {}), '404')
|
||
|
|
})
|