Skip to content

Commit 51f9cf6

Browse files
chore(deps): Upgrade testing dependencies (#7167)
- Remove react-testing-library. This package was not used and is not what you think it is. - Remove @react-testing-library/react since we aren't even using this - Upgrade various testing packages to their latest versions
1 parent 8a492ff commit 51f9cf6

File tree

6 files changed

+1148
-2035
lines changed

6 files changed

+1148
-2035
lines changed

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ module.exports = {
1010
'^sentry-docs/(.*)': '<rootDir>/src/$1',
1111
'.+\\.(css|styl|less|sass|scss)$': `identity-obj-proxy`,
1212
'.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': `<rootDir>/__mocks__/file-mock.js`,
13-
'^gatsby-page-utils/(.*)$': `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
13+
// '^gatsby-page-utils/(.*)$': `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
1414
},
1515
testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
1616
transformIgnorePatterns: [`node_modules/(?!(gatsby|gatsby-script|gatsby-link)/)`],
1717
globals: {
1818
__PATH_PREFIX__: ``,
1919
},
20+
testEnvironment: 'jsdom',
2021
testEnvironmentOptions: {
2122
url: `http://localhost`,
2223
},

package.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"gatsby-transformer-json": "^4.0.0",
5050
"gatsby-transformer-remark": "^5.0.0",
5151
"gray-matter": "^4.0.2",
52-
"jsdom": "^22.0.0",
52+
"jsdom": "^22.1.0",
5353
"platformicons": "^5.6.0",
5454
"prism-sentry": "^1.0.2",
5555
"prismjs": "^1.27.0",
@@ -78,18 +78,16 @@
7878
"xmlhttprequest-ssl": ">=1.6.2"
7979
},
8080
"devDependencies": {
81-
"@testing-library/jest-dom": "^5.11.4",
82-
"@testing-library/react": "^10.4.9",
83-
"@testing-library/react-hooks": "^3.4.1",
81+
"@testing-library/react-hooks": "^8.0.1",
8482
"@untitaker/hyperlink": "^0.1.28",
85-
"babel-jest": "^26.3.0",
83+
"babel-jest": "^29.5.0",
8684
"eslint": "^8.40.0",
8785
"eslint-config-sentry-docs": "^1.117.0",
88-
"jest": "^26.4.2",
86+
"jest": "^29.5.0",
8987
"jest-dom": "^4.0.0",
88+
"jest-environment-jsdom": "^29.5.0",
9089
"prettier": "^2.8.7",
91-
"react-test-renderer": "^16.13.1",
92-
"react-testing-library": "^8.0.1",
90+
"react-test-renderer": "^17.0.0",
9391
"ts-jest": "^29.1.0"
9492
},
9593
"scripts": {

setup-test-env.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/* eslint-env node */
22
/* eslint import/no-nodejs-modules:0 */
33

4-
// https://www.gatsbyjs.com/docs/unit-testing/
5-
import '@testing-library/jest-dom/extend-expect';
6-
74
global.___loader = {
85
enqueue: jest.fn(),
96
};

0 commit comments

Comments
 (0)