Skip to content

Commit d40ce92

Browse files
committed
docs: Broken URL
Change broken URL: `docs.nestjs/com`. It should probably be: ```html <a href="https://docs.nestjs.com/fundamentals/module-ref#resolving-scoped-providers">here</a> ```
1 parent 2926994 commit d40ce92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/fundamentals/unit-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ The compiled module has several useful methods, as described in the following ta
304304

305305
[Request-scoped](/fundamentals/injection-scopes) providers are created uniquely for each incoming **request**. The instance is garbage-collected after the request has completed processing. This poses a problem, because we can't access a dependency injection sub-tree generated specifically for a tested request.
306306

307-
We know (based on the sections above) that the `resolve()` method can be used to retrieve a dynamically instantiated class. Also, as described <a href="https://docs.nestjs/com/fundamentals/module-ref#resolving-scoped-providers">here</a>, we know we can pass a unique context identifier to control the lifecycle of a DI container sub-tree. How do we leverage this in a testing context?
307+
We know (based on the sections above) that the `resolve()` method can be used to retrieve a dynamically instantiated class. Also, as described <a href="https://docs.nestjs.com/fundamentals/module-ref#resolving-scoped-providers">here</a>, we know we can pass a unique context identifier to control the lifecycle of a DI container sub-tree. How do we leverage this in a testing context?
308308

309309
The strategy is to generate a context identifier beforehand and force Nest to use this particular ID to create a sub-tree for all incoming requests. In this way we'll be able to retrieve instances created for a tested request.
310310

0 commit comments

Comments
 (0)