Skip to content

Commit 1ccdf76

Browse files
committed
docs(fundamentals): add mention on overrideProvider limitation
Add documentation for the behavior described here: nestjs/nest#4053 (comment)
1 parent 2357a7d commit 1ccdf76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/fundamentals/unit-testing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ Each of the override methods returns an object with 3 different methods that mir
325325
Each of the override method types, in turn, returns the `TestingModule` instance, and can thus be chained with other methods in the [fluent style](https://en.wikipedia.org/wiki/Fluent_interface). You should use `compile()` at the end of such a chain to cause Nest to instantiate and initialize the module.
326326
327327
Also, sometimes you may want to provide a custom logger e.g. when the tests are run (for example, on a CI server). Use the `setLogger()` method and pass an object that fulfills the `LoggerService` interface to instruct the `TestModuleBuilder` how to log during tests (by default, only "error" logs will be logged to the console).
328+
329+
> warning **Warning** The `@nestjs/core` package exposes unique provider tokens with the `APP_` prefix to help on define global enhancers. Those tokens cannot be overriden since they can represent multiple providers. Thus you can't use `.overrideProvider(APP_GUARD)` (and so on). If you want to override some global enhancer, follow [this workaround](https://github.com/nestjs/nest/issues/4053#issuecomment-585612462).
328330
329331
The compiled module has several useful methods, as described in the following table:
330332

0 commit comments

Comments
 (0)