Home > Mobile >  Jasmine testing Ionic Icons svg not found
Jasmine testing Ionic Icons svg not found

Time:11-17

enter image description here

When I try to test my Ionic/Angular app with Jasmine it can't seem to find any of the Ionic Icons I used, so it throws a 404 for all of them. All the tests pass but its hard to read since the errors take up quite a lot of space so if one does fail its annoying.

The icon do work in the normal code.

How do I include the SVGs into my tests?

CodePudding user response:

I think in the imports array of TestBed.configureTestingModule, you need to import that module responsible for painting the Ionic Icons.

You can also set up proxies to get rid of those 404 errors as outlined in this post: https://stackoverflow.com/a/58291420/7365461.

  • Related