-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverrideMiddleware is missing #4073
Comments
For anyone looking for a workaround - you can simply override the module class and provide a different |
I didn't get your comment @kamilmysliwiec , like for below example how can i do ?
|
@tkskumar would be something like this:
|
Hi everyone, good afternoon. I'm working on that to add this functionality to the current testing module capabilities. |
@micalevisk is all that boilerplate actually required? Couldn't one get away with: |
There is no difference between yours and mine, you've just removed that temporary variable. |
Hi everyone, I implemented the desired |
Let's track this here #12541 |
What is the status of this issue? @schiemon @kamilmysliwiec |
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
oroverrideInterceptor
, it would be useful to have a similaroverrideMiddleware
function for testing purposes.What is the motivation / use case for changing the behavior?
Better/easier testability of NestJs applications!
The text was updated successfully, but these errors were encountered: