angular-extensions / pretty-html-log

A module that allows you to pretty print the inner HTML of ComponentFixtures, DebugElements, NativeElements or even plain HTML strings to the console. This is very useful for debugging Angular component tests in Jest
MIT License
39 stars 1 forks source link

[Question] Does phl print #shadow-root? #57

Open dereklin opened 1 year ago

dereklin commented 1 year ago

I am currently debugging a jest test where I am using phl on a component that renders a web component that uses #shadow-root. I am not seeing any #shadow-root or its children when using phl.

I am wondering if phl will print out #shadow-root like how it is displayed in chrome dev tool. (the web component might not be rendered correctly in the test)

dereklin commented 1 year ago

Looks like it doesn't. I was able to get more output using:

console.log(webComponent.nativeElement.shadowRoot.innerHTML);
kreuzerk commented 1 year ago

Thx a lot for reporting this. Can you try if it works when you enable comments printing? phl(fixture, true);

dereklin commented 1 year ago

Hi @kreuzerk , phl(fixture, true) is not printing out the shadowRoot either

pct-cclausen commented 1 year ago

I am also looking for this feature