polyfills
                                
                                
                                
                                    polyfills copied to clipboard
                            
                            
                            
                        [scoped-custom-element-registry] Add basic jsdom tests
jsdom currently has a bug where it reads the global custom elements registry by looking through the sandbox-facing customElements property of its global object. This means that scripts running in that context can break jsdom's custom elements implementation by overwriting or deleting the customElements global.
I'm making a PR to fix jsdom upstream. Once jsdom and jest-environment-jsdom are released with updated versions, these tests should pass.
- [x] https://github.com/jsdom/jsdom/pull/3454
 
Closes https://github.com/webcomponents/polyfills/issues/459.
jsdom 20.0.2 contains the PR with the fix. jest-environment-jsdom depends on jsdom@^20.0.0 so its not guaranteed to use 20.0.2. Adding jsdom@^20.0.2 as a dev dependency here would satisfy node's deduping during installation of jest-environment-jsdom, but I don't think it's a great idea to rely on that behavior so I'll keep this open until it depends on at least 20.0.2.
Adding
jsdom@^20.0.2as a dev dependency here would satisfy node's deduping during installation ofjest-environment-jsdom
I'm trying this out here: https://github.com/webcomponents/polyfills/commit/39e3f06c7b2be69bbe9b0b1c3220480a81409095
Except for the formatting, the tests passed on that commit. I reformatted and pushed here. (These still won't pass until jest-environment-jsdom is updated.)
Added "Skip Changelog" label because there are no user-facing changes.