overleaf/libraries/o-error/test/http.test.js

21 lines
420 B
JavaScript
Raw Normal View History

2019-07-26 12:14:56 -04:00
const OError = require('..')
const HttpErrors = require('../http')
describe('OError/http', () => {
it('is instance of OError', () => {
try {
throw new HttpErrors.ConflictError()
} catch (e) {
expect(e).to.be.instanceof(OError)
}
})
it('has status code', () => {
try {
throw new HttpErrors.ConflictError()
} catch (e) {
expect(e.statusCode).to.equal(409)
}
})
})