From 2dd4429c964318df26ad89e64807d6bb9b38774c Mon Sep 17 00:00:00 2001 From: Gil Tichon Date: Mon, 20 Nov 2023 10:47:03 +0100 Subject: [PATCH] Update unit-testing.md Removed a warning about global enhancers with a link to a workaround in Github as the workaround is the very next section --- content/fundamentals/unit-testing.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/fundamentals/unit-testing.md b/content/fundamentals/unit-testing.md index f64fafbfb8..aa759dc230 100644 --- a/content/fundamentals/unit-testing.md +++ b/content/fundamentals/unit-testing.md @@ -336,8 +336,6 @@ Each of the override method types, in turn, returns the `TestingModule` instance 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). -> warning **Warning** The `@nestjs/core` package exposes unique provider tokens with the `APP_` prefix to help on define global enhancers. Those tokens cannot be overridden 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). - The compiled module has several useful methods, as described in the following table: