mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
add common HTTP errors
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user