Skip to content

Commit 0482ca3

Browse files
committed
Upgrade jest
1 parent b1709dd commit 0482ca3

File tree

4 files changed

+1206
-1857
lines changed

4 files changed

+1206
-1857
lines changed

config-jest/setup/shims.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
require('airbnb-js-shims/target/es2019');
2+
3+
const { TextEncoder, TextDecoder } = require('util');
4+
5+
global.TextEncoder = TextEncoder;
6+
global.TextDecoder = TextDecoder;

jest.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('jest').Config} */
12
module.exports = {
23
bail: false,
34
collectCoverageFrom: [
@@ -39,8 +40,13 @@ module.exports = {
3940
setupFiles: ['<rootDir>/config-jest/setup/shims.js', '<rootDir>/config-jest/setup/console.js'],
4041
setupFilesAfterEnv: ['<rootDir>/config-jest/setup/enzyme.js'],
4142
testEnvironment: 'jsdom',
42-
testURL: 'http://localhost',
43-
timers: 'fake',
43+
testEnvironmentOptions: {
44+
url: 'http://localhost',
45+
},
46+
fakeTimers: {
47+
enableGlobally: true,
48+
legacyFakeTimers: true,
49+
},
4450
verbose: false,
4551
testPathIgnorePatterns: ['<rootDir>/packages/visx-demo'],
4652
transformIgnorePatterns: [

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
"@testing-library/react-hooks": "^8.0.0",
7373
"@testing-library/user-event": "^11.0.1",
7474
"@types/enzyme": "^3.10.3",
75-
"@types/jest": "^24.0.18",
76-
"@types/jsdom": "^12.2.4",
75+
"@types/jest": "^29.5.14",
76+
"@types/jsdom": "^21.1.7",
7777
"@types/node-fetch": "1.6.9",
7878
"@types/react-test-renderer": "^18.0.0",
7979
"@typescript-eslint/eslint-plugin": "^5.46.1",
@@ -89,7 +89,7 @@
8989
"eslint-config-airbnb": "^19.0.4",
9090
"eslint-config-prettier": "^8.5.0",
9191
"eslint-plugin-import": "^2.26.0",
92-
"eslint-plugin-jest": "^27.1.7",
92+
"eslint-plugin-jest": "^28.9.0",
9393
"eslint-plugin-jsx-a11y": "^6.6.1",
9494
"eslint-plugin-prettier": "^4.2.1",
9595
"eslint-plugin-promise": "^6.1.1",
@@ -100,7 +100,8 @@
100100
"filesize": "6.1.0",
101101
"fs-jetpack": "^1.3.0",
102102
"husky": "^3.0.0",
103-
"jest": "^25.5.4",
103+
"jest": "^29.7.0",
104+
"jest-environment-jsdom": "^29.7.0",
104105
"jest-mock-console": "^1.0.1",
105106
"lerna": "^7.0.2",
106107
"marked": "^0.7.0",

0 commit comments

Comments
 (0)