I have a few circular dependencies in my application. It doesn't affect in production, the app works OK. But now I started to write unit tests using jest and now some of my imports returns undefined. And because of that I can't write a single test.
Even when I try to render whole application, there are a few undefined in the imports.
I can't remove these circular dependencies, because it would take a lot of time.
How can I deal with it?
Here are some examples of errors given by Jest
TypeError: Cannot read properties of undefined (reading 'sensorTypeRenderer')
4 | import { Renderers, ColumnDescriptionGenerators } from '@components';
> 6 | import sensorTypeRenderer = Renderers.sensorTypeRenderer;
Here's the service is not found because EventsGroupsStore is undefined
ServiceNotFoundError: Service with "<UNKNOWN_IDENTIFIER>" identifier was not found...
> 204 | return Container.get(EventsGroupsStore);