In my angular Application , I have a page where i load bunch of images.
All those images comes from a library. So when ever I run my spec test I get an error
404: /_karmawebpack_//assets/images/my_image.svg
We use karma-jasmine for testing and our library is packaged using karma-webpack.
The scope is only spec test - I can ignore the images being rendered in spec test.
Is there a way I can mock all such url and return a dummy url instead of that, as per shown below
/_karmawebpack_//assets/images/* --> .//favicon.ico
I tried few things using router - but it didn't help much
This might help someone
After trying out multiple combination below karma config change worked for me
It needs to find the path of the resources in the component - so a proxy config will be needed for it
so the paths here are
After adding this - it did not complain about missing images .