Skip to main content

mockErrorHandler()

Home > @backstage/backend-test-utils > mockErrorHandler

A mock for error handler middleware that can be used in router tests.

Signature:

function mockErrorHandler(_options?: {}, ..._args: never[]): import("express").ErrorRequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;

Parameters

Parameter

Type

Description

_options

{}

(Optional)

_args

never[]

**Returns:**

import("express").ErrorRequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>

Example

const app = express();
app.use(mockErrorHandler());