Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

relative baseUrl path for unit tests #137

Open
michahell opened this issue May 4, 2020 · 3 comments
Open

relative baseUrl path for unit tests #137

michahell opened this issue May 4, 2020 · 3 comments

Comments

@michahell
Copy link

michahell commented May 4, 2020

Hi,

this is not a blocker but I would like to point to a different (relative) URL for Angular unit tests, so we don't see 404's in the spec output:

04 05 2020 13:33:42.878:WARN [web-server]: 404: /assets/icons/search.svg

I tried the following baseUrl:

InlineSVGModule.forRoot({
  baseUrl: '../../libs'
})

but the ../../ part seems to be removed:

04 05 2020 13:33:42.878:WARN [web-server]: 404: /libs/assets/icons/search.svg

This does not seem to explicitly happen in getAbsoluteUrl():

getAbsoluteUrl(url: string): string {

When I put a console log there to see what url and _baseUrl are, I do see:
'/assets/icons/search.svg' and '../../libs' consecutively.
So I know that the config override is applied, at least.

@arkon
Copy link
Owner

arkon commented May 30, 2020

I imagine it's getting lost here:

const base = this._renderer.createElement('BASE');
base.href = url;
return base.href;

Does that relative path actually resolve to a valid URL? (i.e. what's the absolute form of it?)

@michahell
Copy link
Author

Yes, this was my finding as well! Not sure why I forgot to add this to the original issue.

@michahell
Copy link
Author

I am picking this up again. I'm trying to debug my unit tests while including a breakpoint in said service on mentioned line, but having a bit of trouble getting the breakpoint to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants