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

21 lines
438 B
JavaScript
Raw Normal View History

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