Serve assets files from ng test#3628
Conversation
f8148bf to
082e260
Compare
|
@filipesilva could you review? This LGTM but I want your eyes on it since you did the same for |
082e260 to
9ba5000
Compare
filipesilva
left a comment
There was a problem hiding this comment.
Logic, implementation and test seem solid. I left a question but it's mostly curiosity.
Thanks for making this happen @Meligy, cheers!
| served: true, | ||
| watched: true | ||
| }); | ||
| config.proxies['/' + proxyPath] = '/base/' + appConfig.root + '/' + proxyPath; |
There was a problem hiding this comment.
Are proxies always needed?
There was a problem hiding this comment.
I'm no karma expert and worked my way through trial and error really, but according to the docs and my tries, when you add a file to the files array, it gets served from /base/src/path-to-file only. The proxy adds another endpoint (like a URL rewrite) from /path-to-file to /base/src/path-to-file.
There was a problem hiding this comment.
@filipesilva I added a comment explaining why we need proxies.
There was a problem hiding this comment.
Yes that makes sense to me. I remember a similar situation I ran into another project. Without the proxy, fetch would not work correctly.
9ba5000 to
6d302e4
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #2803.
This pull request makes the files in the
assetsproperty ofangular-cli.jsonget served from the web server runningng testtests.It's very heavily inspired by @filipesilva's similar pull request #3543 that adds similar support for the
scriptsproperty (Thanks heaps Mr Filipe!).