Fix @skatejs/ssr
in jsdom
environment
#1575
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NodeList
s don't have amap
method.See https://developer.mozilla.org/en-US/docs/Web/API/NodeList
If there is a linked issue, mention it here.
Requirements
Rationale
Why is this PR necessary?
NodeList
s don't have amap
method.See https://developer.mozilla.org/en-US/docs/Web/API/NodeList
I have existing tests using
undom
but I've had a lot of luck switching over to https://github.com/SimenB/jest-environment-jsdom-sixteen (see https://github.com/jsdom/jsdom/releases/tag/16.2.0).Implementation
Why have you implemented it this way? Did you try any other methods?
I considered using Array spread or
Array.from
but went with this approach to avoid creating arrays. Happy to change the implementation for terseness though.Open questions
Are there any open questions about this implementation that need answers?
Other
Is there anything else we should know? Delete this section if you don't need it.
I've tested both this approach (as well as using Array spread) in my project via https://github.com/ds300/patch-package and everything works.