* Bump jsdom from 16.7.0 to 18.0.0 Bumps [jsdom](https://github.com/jsdom/jsdom) from 16.7.0 to 18.0.0. - [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/16.7.0...18.0.0) --- updated-dependencies: - dependency-name: jsdom dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Added custom environment for JS DOM to support text encoding/decoding. * Fixed yarn.lock merge conflict. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nick Taylor <nick@dev.to> Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
14 lines
482 B
JavaScript
14 lines
482 B
JavaScript
/* eslint-env node */
|
|
// See https://github.com/jsdom/jsdom/issues/2524#issuecomment-736672511
|
|
const Environment = require('jest-environment-jsdom');
|
|
|
|
module.exports = class CustomTestEnvironment extends Environment {
|
|
async setup() {
|
|
await super.setup();
|
|
if (typeof this.global.TextEncoder === 'undefined') {
|
|
const { TextEncoder, TextDecoder } = require('util');
|
|
this.global.TextEncoder = TextEncoder;
|
|
this.global.TextDecoder = TextDecoder;
|
|
}
|
|
}
|
|
};
|