express-response-errors
Advanced tools
Comparing version
{ | ||
"name": "express-response-errors", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Collection of custom response errors and middleware for express", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -14,4 +14,4 @@ const express = require('express') | ||
function testResponse (server, code, message, done) { | ||
request(server) | ||
function sendRequest (app, code, message, done) { | ||
request(app) | ||
.get('/') | ||
@@ -43,3 +43,3 @@ .expect(code, { message }, done) | ||
testResponse(server, HTTP_URI_TOO_LONG, 'URI Too Long', done) | ||
sendRequest(app, HTTP_URI_TOO_LONG, 'URI Too Long', done) | ||
}) | ||
@@ -54,3 +54,3 @@ | ||
testResponse(server, HTTP_URI_TOO_LONG, 'TL;DR', done) | ||
sendRequest(app, HTTP_URI_TOO_LONG, 'TL;DR', done) | ||
}) | ||
@@ -67,3 +67,3 @@ }) | ||
testResponse(server, HTTP_URI_TOO_LONG, 'URI Too Long', done) | ||
sendRequest(app, HTTP_URI_TOO_LONG, 'URI Too Long', done) | ||
}) | ||
@@ -78,5 +78,5 @@ | ||
testResponse(server, HTTP_URI_TOO_LONG, 'TL;DR', done) | ||
sendRequest(app, HTTP_URI_TOO_LONG, 'TL;DR', done) | ||
}) | ||
}) | ||
}) |
@@ -105,1 +105,5 @@ // Type definitions for express-response-errors 1.0.3 | ||
export const VariantAlsoNegotiatesError: NamedHttpErrorConstructor<VariantAlsoNegotiatesError>; | ||
// Middleware | ||
export function responseErrorHandler(err: object, req: object, res: object, next: Function): void; |
16582
0.58%289
0.7%