mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:53:40 -05:00
32 lines
671 B
JavaScript
32 lines
671 B
JavaScript
const { expect } = require('chai')
|
|
|
|
const HttpErrors = require('../http')
|
|
|
|
const { expectError } = require('./support')
|
|
|
|
describe('OError/http', function () {
|
|
it('is a valid OError', function () {
|
|
function foo() {
|
|
throw new HttpErrors.ConflictError()
|
|
}
|
|
|
|
try {
|
|
foo()
|
|
} catch (error) {
|
|
expectError(error, {
|
|
name: 'ConflictError',
|
|
klass: HttpErrors.ConflictError,
|
|
message: 'ConflictError: Conflict',
|
|
firstFrameRx: /foo/,
|
|
})
|
|
}
|
|
})
|
|
|
|
it('has status code', function () {
|
|
try {
|
|
throw new HttpErrors.ConflictError()
|
|
} catch (e) {
|
|
expect(e.statusCode).to.equal(409)
|
|
}
|
|
})
|
|
})
|