forked from ProjectMirador/mirador
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEMP: Jest/JSDOM does not yet implement core JS behaviors from Node 17
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import JSDOMEnvironment from 'jest-environment-jsdom'; | ||
|
||
/** | ||
* JSDOM has a documented issue re: missing support of core JS available since Node 17 | ||
* e.g. https://github.com/jsdom/jsdom/issues/1721 | ||
* e.g. https://github.com/jsdom/jsdom/issues/3363 | ||
*/ | ||
export default class PatchedJSDOMEnvironment extends JSDOMEnvironment { | ||
/** */ | ||
constructor(...args) { | ||
super(...args); | ||
|
||
// delegate to node for structuredClone | ||
this.global.structuredClone = structuredClone; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters