Prerequisites
Stencil Version
2.14.0
Current Behavior
this.el.getRootNode() instanceof ShadowRoot
I try to know if my custom component is in a shadowDOM.
It works well but not in specs test.
I have this error ReferenceError: ShadowRoot is not defined
Expected Behavior
No error in test when we use ShadowRoot
Steps to Reproduce
Try to test if the host element is in a shadowDOM context
this.el.getRootNode() instanceof ShadowRoot
Then run unit tests.
Code Reproduction URL
https://github.com/ryuran/stencil-bugs
Additional Information
Workaround
Mock:
global.DocumentFragment = class DocumentFragment extends Node {};
global.ShadowRoot = class ShadowRoot extends DocumentFragment {};
Prerequisites
Stencil Version
2.14.0
Current Behavior
this.el.getRootNode() instanceof ShadowRootI try to know if my custom component is in a shadowDOM.
It works well but not in specs test.
I have this error
ReferenceError: ShadowRoot is not definedExpected Behavior
No error in test when we use
ShadowRootSteps to Reproduce
Try to test if the host element is in a shadowDOM context
this.el.getRootNode() instanceof ShadowRootThen run unit tests.
Code Reproduction URL
https://github.com/ryuran/stencil-bugs
Additional Information
npm inpm testWorkaround
Mock: