-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
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!
tonivj5, evanrooijen, dlycakis32, ahilke, JohnnysMartins and 8 more