diff --git a/http-errors/http-errors-tests.d.ts b/http-errors/http-errors-tests.d.ts deleted file mode 100644 index 9005c7ef41..0000000000 --- a/http-errors/http-errors-tests.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Type definitions for http-errors-tests.ts -declare namespace Express { - export interface Request { - user?: any - } -} diff --git a/http-errors/http-errors-tests.ts b/http-errors/http-errors-tests.ts index f8e0ea9b8c..61fb9091bf 100644 --- a/http-errors/http-errors-tests.ts +++ b/http-errors/http-errors-tests.ts @@ -1,12 +1,19 @@ /// /// -/// import * as createError from 'http-errors'; import * as express from 'express'; var app = express(); +declare global { + namespace Express { + export interface Request { + user?: any + } + } +} + app.use(function (req, res, next) { if (!req.user) return next(createError(401, 'Please login to view this page.')); next();