You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

express-response-errors

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-response-errors - npm Package Compare versions

Comparing version

to
1.0.2

2

package.json
{
"name": "express-response-errors",
"version": "1.0.1",
"version": "1.0.2",
"description": "Collection of custom response errors and middleware for express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -33,10 +33,10 @@ const express = require('express')

afterEach(() => {
server.close()
afterEach(done => {
server.close(done)
})
describe('Base Exception', () => {
it('should set code and default message', (done) => {
const handler = () => {
throw new HttpError(HTTP_URI_TOO_LONG)
it('should set code and default message', done => {
const handler = (req, res, next) => {
next(new HttpError(HTTP_URI_TOO_LONG))
}

@@ -49,5 +49,5 @@

it('should set code and custom message', (done) => {
const handler = () => {
throw new HttpError(HTTP_URI_TOO_LONG, 'TL;DR')
it('should set code and custom message', done => {
const handler = (req, res, next) => {
next(new HttpError(HTTP_URI_TOO_LONG, 'TL;DR'))
}

@@ -61,6 +61,6 @@

describe('Custom Exceptions', () => {
it('should set code and default message', (done) => {
const handler = () => {
throw new UriTooLongError()
describe('Http specific exceptions', () => {
it('should set code and default message', done => {
const handler = (req, res, next) => {
next(new UriTooLongError())
}

@@ -73,5 +73,5 @@

it('should set code and custom message', (done) => {
const handler = () => {
throw new UriTooLongError('TL;DR')
it('should set code and custom message', done => {
const handler = (req, res, next) => {
next(new UriTooLongError('TL;DR'))
}

@@ -78,0 +78,0 @@