how to fix images causing "karma WARN [web-server]: 404"? -


i have angular directive template doing like:

<img ng-src="{{url}}" /> 

in test, setting scope url points fictitious image... karma says:

warn [web-server]: 404: /fake.png 

so go karma config file , add files array:

{pattern: 'spec/javascripts/fixtures/**/*.png', watched: false, included: false, served: true}, 

and added proxies:

proxies: {   '/fake.png': 'spec/javascripts/fixtures/assets/fake.png' } 

...

now get:

warn [proxy]: failed proxy spec/javascripts/fixtures/assets/fake.png ([object object]) 

?

that path correct, , there real image called fake.png there.

the basepath in config set root of project...

i figured out through random trial , error. apparently have use magic word "base" in path.

proxies: {   '/fake.png': '/base/spec/javascripts/fixtures/assets/fake.png' } 

now works, let's honest, prepending "/base" seems nonsense.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -