I am running the following command to unit test and generate code code coverage report.
ng test --code-coverage
It is writing code coverage re
I had the same issue and I found a simple workaround that does the trick for me without any big configuration.
import './app.module';
That's it ;)
The point is, your app module is most likely the central part of your application which imports any other used files directly or indirectly. Now that you have created the spec file, everything that is included by your module should also be included in the test coverage report.
I am not 100% sure if this works with lazy loaded modules. If not, you can simply import those lazy loaded modules in your app.module.spec.ts as well, or create a spec file per module, where you import the module.