I have got an issue that I met in your GitHub issues.
I can not create a testing module Test.createTestingModule
for testing that uses circular dependency.
Here https://github.com/nestjs/nest/issues/4688 I read the reason why it is a bad idea and why we should avoid it.
The main point is that it is a unity test, and we should not use forwardRef
we need to build a test bad and mock. The author of the issue described that he needed it for e2e tests. I like to write tests in an integration style like e2e does and check and develop the real functionality. I also need to support forwardRef
. For me, it looks like createTestingModule
does not support forwardRef
wrapper. My opinion is that it has to be because it is a part of the core. I am covering this by testing a service with many convoluted dependencies. It becomes a hell to describe it. Yes, we can create a helper factory. But it is also a problem to support it. I am looking for an elegant solution. I would like to do it without code refactoring. But for now, it is impossible.
Regards.