lathonez/clicker

Unit testing IonicPageModule & IonicModule

alexmgrant opened this issue · 3 comments

Any thoughts on the setup for testing an app using Ionic's lazy loading?

Hi Alex.

I've not used it (or looked at it at all) until just now. Looks like something we will need to use though.

Having a quick scan of the blog, I can't see that the testing setup would need to be any different.

What issues are you running into?

Stephen

Please reopen if you have anything to share

I am attempting to do this myself and I ran into a minor annoyance.

The beforeEachCompiler method expects that a component can be passed in. This works for normal components, but Pages can only be declared in one module. If a lazy loaded module is present, it complains that the page is also present in the DynamicTestModule

Solution in my case was to skip beforeEachCompiler and use configureIonicTestingModule instead.