Skip to content

Commit

Permalink
Bump jest from 27.5.1 to 28.1.0 (forem#17612)
Browse files Browse the repository at this point in the history
* Bump jest from 27.5.1 to 28.1.0

Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 27.5.1 to 28.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v28.1.0/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* resolve upgrade errors

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <[email protected]>
  • Loading branch information
dependabot[bot] and aitchiss authored May 10, 2022
1 parent 05fcdfc commit c2af21e
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 627 deletions.
16 changes: 14 additions & 2 deletions customJsDomEnvironment.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
/* eslint-env node */
// See https://github.com/jsdom/jsdom/issues/2524#issuecomment-736672511
const Environment = require('jest-environment-jsdom');
const Environment = require('jest-environment-jsdom').default;

module.exports = class CustomTestEnvironment extends Environment {
constructor(config, context) {
super(config, context);
}

async setup() {
await super.setup();
// See https://github.com/jsdom/jsdom/issues/2524#issuecomment-736672511
if (typeof this.global.TextEncoder === 'undefined') {
const { TextEncoder, TextDecoder } = require('util');
this.global.TextEncoder = TextEncoder;
this.global.TextDecoder = TextDecoder;
}
}

async teardown() {
await super.teardown();
}

getVmContext() {
return super.getVmContext();
}
};
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ module.exports = {
'jest-watch-typeahead/testname',
],
testEnvironment: './customJsDomEnvironment.js',
// We occasionally need to allow transpiling of specific node_modules. See https://jestjs.io/docs/configuration#transformignorepatterns-arraystring
transformIgnorePatterns: ['/node_modules/(?!(preact|react-colorful)/)'],
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-react": "^7.29.4",
"husky": "^8.0.1",
"jest": "27.5.1",
"jest": "28.1.0",
"jest-axe": "^6.0.0",
"jest-environment-jsdom": "^28.1.0",
"jest-fetch-mock": "^3.0.3",
"jest-watch-typeahead": "^1.1.0",
"jsdom": "^19.0.0",
Expand Down
Loading

0 comments on commit c2af21e

Please sign in to comment.