Closed Waltari10 closed 4 years ago
I tried importing the lazily loaded files in a separate file and then adding that file to Karmas files in config. This worked except that the tests get stuck. Maybe a promise is not resolving?
Okay, the tests getting stuck was an unrelated issues to this. Apparently we just hit the threshold of having too many tests and we ran out memory. Allocating more fixed the issue, and including the lazily loaded files in a separate file for the Karma tests seem to work fine for now.
Hey,
We are using Karma for unit tests and Webpack for bundling. I get the following error when running tests:
so basically it doesn't seem to be initializing the SiteDocsController code.
The SiteDocsController file looks like this:
And I import it dynamically like so:
This works great when running the app, but when testing it, not so much.
Here is our Karma config:
So how can I initialize dynamically loaded files in the projects unit tests? Thank you!