This is because you need to configure karma for download, and then serve them on request;)
In your karma.conf.js file you should already have certain files and / or templates, for example:
// list of files / patterns to load in the browser files : [ {pattern: 'app/lib/angular.js', watched: true, included: true, served: true}, {pattern: 'app/lib/angular-*.js', watched: true, included: true, served: true}, {pattern: 'app/lib/**/*.js', watched: true, included: true, served: true}, {pattern: 'app/js/**/*.js', watched: true, included: true, served: true}, // add the line below with the correct path pattern for your case {pattern: 'path/to/**/*.png', watched: false, included: false, served: true}, // important: notice that "included" must be false to avoid errors // otherwise Karma will include them as scripts {pattern: 'test/lib/**/*.js', watched: true, included: true, served: true}, {pattern: 'test/unit/**/*.js', watched: true, included: true, served: true}, ], // list of files to exclude exclude: [ ], // ...
You can look here for more information :)
EDIT: If you use the nodejs web server to run your application, you can add it to the karma.conf.js file:
proxies: { '/path/to/img/': 'http://localhost:8000/path/to/img/' },
EDIT2: If you are not using or do not want to use another server, you can define a local proxy server, but since Karma does not provide access to the port used, dynamically, if karma starts from a port other than 9876 (by default), you will still get annoying 404 ...
proxies = { '/images/': '/base/images/' };
Associated issue: https://github.com/karma-runner/karma/issues/872