Files
discordeno/packages/old/rest/tests/unit/RestRequestRejection.spec.ts
2022-12-26 21:00:54 -06:00

18 lines
573 B
TypeScript

import { expect } from 'chai'
import { describe, it } from 'mocha'
import { convertRestError } from '../../src/convertRestError.js'
describe('[rest] convertRestError', () => {
it('Should contain important info', () => {
const convertedError = convertRestError(new Error(), {
status: 404,
error: 'error message',
body: 'error body',
ok: false
})
expect(convertedError.message).to.be.include('404')
expect(convertedError.message).to.be.include('error message')
expect(convertedError.message).to.be.include('error body')
})
})