I\'ve been trying for the past two hours to get Karma runner to serve an svg file and an html fixture but so far no luck.
Following the second answer on this thread:
Answering my own question here...
I was trying to load my fixtures athttp://localhost:9876/fixtures/directional-pad.html
Instead I should have tried accessing them at http://localhost:9876/base/test/fixtures/directional-pad.html
Karma stores everything under the base/
route, so any static file routes you add will need to start with that.
One way to do this is to set-up a proxy server.
A good example of a test system using a proxy server is https://github.com/yearofmoo-articles/AngularJS-Testing-Article
which is the example from Year of Moo's great testing tutorial. http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-testacular.html
You set the proxy up in the karma config file
proxies = {
'/': 'http://localhost:8100/'
};
Then you need to set-up the server on 8100
this can be done using http-server
npm install http-server --save-dev
then create two files
nf --procfile ./config/Procfile.server start
web_server: ./node_modules/http-server/bin/http-server -p 8100 preview/public
Then you need to run you server
./server.sh
Then when you run the tests, the proxy will serve up your files.