#Test coverage, ignore specific files like app.module.ts or not?

6 messages · Page 1 of 1 (latest)

open marten
#

Hey there, how do you usually approach testing some files that might not make sense be tested, for example, do you write unit tests for your module files?

graceful palm
#

Generally I ignore module files. I treat them as configuration. If I really need to test my factories, I extract them out to another file so I can import them directly

open marten
#

do you ignore in jest or add a basic spec file to test if the module file is being instantiated correctly?

graceful palm
#

I never instantiate my modules, that's something the framework handles, so I ignore it at the coverage collection level

open marten
#

@graceful palm do you have an example of a jest config file to share?

#

currently we do create .spec files for the modules just to not have those hitting the overall coverage, could also just ignore with the istanbul comment per file