Skip to content
Discussion options

You must be logged in to vote

Hi @RWOverdijk

The main point to note is that Suites is primarily intended for testing classes that have injected dependencies, rather than for testing providers themselves. The main function of Suites is to oversee the dependency graph for class-based components.
By applying TestBed.solitary() you set a testing environment for a class that might have dependencies injected into it. The UnitRef provides access to the injected dependencies, allowing for configuration or verification.

For your goal of conducting a straightforward functional unit test of the provider, the testing utilities provided by NestJS are indeed more suitable, which clarifies why that method was effective for you. The …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@RWOverdijk
Comment options

Answer selected by omermorad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants