mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
chore(deps): bump jsdom from 15.2.1 to 20.0.2 (#6591)
* chore(deps): bump jsdom from 15.2.1 to 20.0.2
Bumps [jsdom](https://github.com/jsdom/jsdom) from 15.2.1 to 20.0.2.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/15.2.1...20.0.2)
---
updated-dependencies:
- dependency-name: jsdom
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* fix(deps): Import jsdom correctly
Use the JSDOM constructor to create a JSDOM instance and then
obtain the needed polyfills from that instances .window property.
* chore(tests): Revert "Updates dependabot to ignore jsdom changes (#4777)"
This reverts commit be1dcb4b94.
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
This commit is contained in:
@@ -16,9 +16,10 @@
|
||||
// Override textToDomDocument and provide Node.js alternatives to DOMParser and
|
||||
// XMLSerializer.
|
||||
if (typeof globalThis.document !== 'object') {
|
||||
const jsdom = require('jsdom/lib/jsdom/living');
|
||||
globalThis.DOMParser = jsdom.DOMParser;
|
||||
globalThis.XMLSerializer = jsdom.XMLSerializer;
|
||||
const {JSDOM} = require('jsdom');
|
||||
const {window} = new JSDOM(`<!DOCTYPE html>`);
|
||||
globalThis.DOMParser = window.DOMParser;
|
||||
globalThis.XMLSerializer = window.XMLSerializer;
|
||||
const xmlDocument = Blockly.utils.xml.textToDomDocument(
|
||||
`<xml xmlns="${Blockly.utils.xml.NAME_SPACE}"></xml>`);
|
||||
Blockly.utils.xml.setDocument(xmlDocument);
|
||||
|
||||
Reference in New Issue
Block a user