There should be a way to ask karma to serve a specific directory in a given path
See original GitHub issueThere should be a way to specify karma that a specific content should be served from a specified path. Right now, the only (very hacky) way to do this is
files = [
{pattern: 'images/*.png', included: false, served: true}
];
proxies = {
'/images': 'http://localhost:9876/base/images'
};
That has the big issue that, when the configuration is run, we cannot be positive that karma will run at port 9876 or another port
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
karma config moving a file to base directory - Stack Overflow
Karma does this because there's no simple way to provide a path to these files through the usual /base/ path that is both...
Read more >Configuration options | karma
Karma will be performing authentication using configured list of username & password pairs. This method is only recommended for testing. External authentication ...
Read more >Configuration File - Karma
The easiest way to generate an initial configuration file is by using the karma init command. This page lists all of the available...
Read more >Testing - Angular
The Angular CLI takes care of Jasmine and Karma configuration for you. It constructs the full configuration in memory, based on options specified...
Read more >Front-End Unit Testing Using Karma Test Runner
#1) basePath: This configuration bears the name of any folder which should be used to resolve the path information provided for test and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
None of those answers solved this annoying 404 warn.
I’ve this setup in my karma.conf.js:
with proxies setup I got this warn:
WARN [web-server]: 404: /base/image.png
without proxies setup I got this warn:
@glepretre I think I like your suggestion the best, this should work:
We just need to fix https://github.com/karma-runner/karma/blob/master/lib/middleware/proxy.js#L37-L42 - if no host/port is defined, use the Karma ones (proxy to Karma itself). Anybody willing to send a PR for this?