简体   繁体   中英

Jasmine testing Ionic Icons svg not found

在此处输入图片说明

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM