karma-runner / karma-runner/karma
Add suffix '.html' in PROXIES value
- Dominant language
- JavaScript
- Stars
- 12k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
I have unit tests in Angular 4. There is 1 component, which has iframe. The sourse of this iframe might be different, but the first part of the path is the same for each iframe.
so, it might also be /htm/dialogs/SelectDialog1, /htm/dialogs/SelectDialog2 etc.
When I test it, it tries to load this file /htm/dialogs/SelectDialog So, that's why I added this configuration in karma.config.js
proxies: {
'/htm/dialogs/': '/base/mock-server/dialogs/'
}
The main problem here that it tries to load this page http://localhost:9876/base/mock-server/dialogs/SelectDialog
However, according to my folder structure, it has to be http://localhost:9876/base/mock-server/dialogs/SelectDialog/index.html
Actually, I can change structure of folders on my mock-server.
Could you please help me how to add '/index.html'. It should be something like this
proxies: {
'/htm/dialogs/': '/base/mock-server/dialogs/****/index.html'
}
Contributor guide
Research direction
Review the proxy configuration entry shown in karma.config.js and trace how the iframe request is mapped. Verify the request for /htm/dialogs/SelectDialog against the mock-server layout; done means the proxy can resolve varying dialog paths to the corresponding index.html page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100