We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79b9163 commit 330a35dCopy full SHA for 330a35d
jest.config.js
@@ -4,7 +4,7 @@
4
*/
5
module.exports = {
6
preset: 'ts-jest',
7
- testEnvironment: 'jest-environment-jsdom',
+ testEnvironment: './src/tests/jsdom-structured-clone-env.js',
8
moduleFileExtensions: [
9
'js',
10
'jsx',
src/tests/jsdom-structured-clone-env.js
@@ -0,0 +1,12 @@
1
+import JSDOMEnvironment from 'jest-environment-jsdom'
2
+
3
+export default class FixJSDOMEnvironment extends JSDOMEnvironment {
+ constructor(...args) {
+ super(...args)
+ // Fix missing support for structuredClone() in jsdom
+ // Ref https://github.com/jsdom/jsdom/issues/3363
+ this.global.structuredClone = structuredClone
11
+ }
12
+}
0 commit comments