Skip to content

OverrideMiddleware is missing #4073

Closed
@vanhumbeecka

Description

@vanhumbeecka

Feature Request

Is your feature request related to a problem? Please describe.

While trying to write tests for NestJS, I'm trying to override nestjs-middleware, by defining it with overrideProvider(MyMiddleware).useValue({ use(req, res, next) { next() }).
This doesn't work however, since he just keeps dropping in the 'real' middleware (MyMiddleware) instead of the overridden one.

Describe the solution you'd like

Just like overrideProvider or overrideInterceptor, it would be useful to have a similar overrideMiddleware function for testing purposes.

What is the motivation / use case for changing the behavior?

Better/easier testability of NestJs applications!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions