forked from aws-amplify/amplify-category-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FixJestEnvironment.js
19 lines (17 loc) · 764 Bytes
/
FixJestEnvironment.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const NodeEnvironment = require('jest-environment-node');
/**
* NOTE: Any fixes in this file should also be ported to packages/amplify-e2e-core/src/cli-test-environment.js
*/
class FixJestEnvironment extends NodeEnvironment {
constructor(...args) {
super(...args);
// https:/jestjs/jest/issues/12628
// structuredClone is missing in the jest node environment.
// Newer versions of jest have fixed this, but is not possible to upgrade at this time.
// Newer versions of jest have a performance issue when not used with Node ^20.11.0
// https:/jestjs/jest/issues/11956
// Our minimum supported version is Node 18.
this.global.structuredClone = structuredClone;
}
}
module.exports = FixJestEnvironment;