Skip to content

Commit be5a252

Browse files
committed
Bump JSDOM to 21.x
1 parent 25dc8a9 commit be5a252

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Diff for: package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"format": "kcd-scripts format",
4848
"install:csb": "npm install",
4949
"lint": "kcd-scripts lint",
50+
"postinstall": "patch-package",
5051
"setup": "npm install && npm run validate -s",
5152
"test": "kcd-scripts test",
5253
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --watch --runInBand",
@@ -68,14 +69,18 @@
6869
"lz-string": "^1.4.4",
6970
"pretty-format": "^27.0.2"
7071
},
72+
"overrides": {
73+
"jsdom": "^21.1.0"
74+
},
7175
"devDependencies": {
7276
"@testing-library/jest-dom": "^5.11.6",
7377
"@types/lz-string": "^1.3.34",
7478
"jest-in-case": "^1.0.2",
7579
"jest-snapshot-serializer-ansi": "^1.0.0",
7680
"jest-watch-select-projects": "^2.0.0",
77-
"jsdom": "20.0.0",
81+
"jsdom": "^21.1.0",
7882
"kcd-scripts": "^13.0.0",
83+
"patch-package": "^6.5.1",
7984
"typescript": "^4.1.2"
8085
},
8186
"eslintConfig": {

Diff for: patches/jest-environment-jsdom+29.4.1.patch

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/node_modules/jest-environment-jsdom/build/index.js b/node_modules/jest-environment-jsdom/build/index.js
2+
index f2f6731..7fcd5ed 100644
3+
--- a/node_modules/jest-environment-jsdom/build/index.js
4+
+++ b/node_modules/jest-environment-jsdom/build/index.js
5+
@@ -161,15 +161,6 @@ class JSDOMEnvironment {
6+
this.global.removeEventListener('error', this.errorEventListener);
7+
}
8+
this.global.close();
9+
-
10+
- // Dispose "document" to prevent "load" event from triggering.
11+
-
12+
- // Note that this.global.close() will trigger the CustomElement::disconnectedCallback
13+
- // Do not reset the document before CustomElement disconnectedCallback function has finished running,
14+
- // document should be accessible within disconnectedCallback.
15+
- Object.defineProperty(this.global, 'document', {
16+
- value: null
17+
- });
18+
}
19+
this.errorEventListener = null;
20+
// @ts-expect-error: this.global not allowed to be `null`

0 commit comments

Comments
 (0)