You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when describing jest tests we have to include all the cascading dependencies of the services in the providers section, which is not good. A better approach is to import the module.ts that contains the service, which should have already the dependencies imported properly using module import section.
To Reproduce
Illustrative example of how it is incorrectly done in the Donations.controller.spec.ts
note the long providers:[] section with specifics coming from nested dependencies
Which area(s) of Podkrepi.bg are affected?
Development Velocity
Describe the Bug
Currently when describing jest tests we have to include all the cascading dependencies of the services in the providers section, which is not good. A better approach is to import the module.ts that contains the service, which should have already the dependencies imported properly using module import section.
To Reproduce
Illustrative example of how it is incorrectly done in the Donations.controller.spec.ts
note the long providers:[] section with specifics coming from nested dependencies
Corrected example:
with almost nothing in the providers section
Expected Behavior
To fix the dependency mess there is a need to refactor the imports and providers sections of the current modules.
Example of how it is wrongly done in the Donations module
Note how the providers:[] section contains many more services than the Donation Module actually contains.
while the correct way should be like this
where the imported modules section contains only direct dependencies, so that we let NestJS to solve the nested dependencies
Which browser are you using? (if relevant)
No response
The text was updated successfully, but these errors were encountered: