testing-library / testing-library/dom-testing-library
prettyDOM should be able to serialize shadowRoots
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- PR merge metrics
- No merged PRs in 30d
Description
Splitting this out from #484
A ShadowRoot is a DocumentFragment node that should be able to be serialized by pretty-format & prettyDOM,
A few changes would be needed in pretty-dom, including removing or altering the check for outerHTML (shadowRoot has innerHTML only) and adding recursive traversal of the node.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/pretty-dom.js by reading the existing outerHTML check and how nodes are traversed. Use the linked ShadowRoot and Node nodeType references to understand the relevant DOM behavior. Done means prettyDOM can serialize ShadowRoot content through recursive traversal without relying on outerHTML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100