http.test.js 420 B

1234567891011121314151617181920
  1. const OError = require('..')
  2. const HttpErrors = require('../http')
  3. describe('OError/http', () => {
  4. it('is instance of OError', () => {
  5. try {
  6. throw new HttpErrors.ConflictError()
  7. } catch (e) {
  8. expect(e).to.be.instanceof(OError)
  9. }
  10. })
  11. it('has status code', () => {
  12. try {
  13. throw new HttpErrors.ConflictError()
  14. } catch (e) {
  15. expect(e.statusCode).to.equal(409)
  16. }
  17. })
  18. })