mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 17:30:07 +00:00
18 lines
573 B
TypeScript
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')
|
|
})
|
|
})
|