Skip to content

Commit 0b95731

Browse files
authored
chore(theme): migrate to Jest 30 (#3020)
Install Jest 30 peer dependencies as required by @backstage/cli 0.36.0 and fix test incompatibilities for Jest 30. Signed-off-by: Jon Koops <jonkoops@gmail.com>
1 parent 7792251 commit 0b95731

7 files changed

Lines changed: 23 additions & 45 deletions

File tree

workspaces/theme/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@
4848
"@backstage/e2e-test-utils": "^0.1.2",
4949
"@backstage/repo-tools": "^0.17.0",
5050
"@changesets/cli": "^2.27.1",
51-
"@jest/environment-jsdom-abstract": "^30.0.0",
51+
"@jest/environment-jsdom-abstract": "^30.3.0",
5252
"@playwright/test": "1.59.1",
5353
"@types/jest": "^30.0.0",
54-
"jest": "^30.2.0",
54+
"@types/jsdom": "^27.0.0",
55+
"jest": "^30.3.0",
5556
"jsdom": "^27.1.0",
5657
"node-gyp": "^9.0.0",
5758
"prettier": "^3.4.2",

workspaces/theme/plugins/theme/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"@material-ui/icons": "^4.11.3",
7272
"@testing-library/jest-dom": "^6.0.0",
7373
"@testing-library/react": "^14.0.0",
74-
"@testing-library/react-hooks": "^8.0.1",
7574
"@testing-library/user-event": "^14.0.0",
7675
"msw": "^1.0.0",
7776
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",

workspaces/theme/plugins/theme/src/hooks/useBranding.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { renderHook } from '@testing-library/react-hooks';
17+
import { renderHook } from '@testing-library/react';
1818
import { useApi } from '@backstage/core-plugin-api';
1919
import { MockConfigApi } from '@backstage/test-utils';
2020
import { JsonObject } from '@backstage/types';

workspaces/theme/plugins/theme/src/hooks/useTheme.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { renderHook } from '@testing-library/react-hooks';
17+
import { renderHook } from '@testing-library/react';
1818
import { useTheme } from './useTheme';
1919

2020
describe('useTheme', () => {

workspaces/theme/plugins/theme/src/hooks/useThemeConfig.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { renderHook } from '@testing-library/react-hooks';
17+
import { renderHook } from '@testing-library/react';
1818
import { useApi } from '@backstage/core-plugin-api';
1919
import { MockConfigApi } from '@backstage/test-utils';
2020
import { JsonObject } from '@backstage/types';

workspaces/theme/plugins/theme/src/hooks/useThemeOptions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { renderHook } from '@testing-library/react-hooks';
17+
import { renderHook } from '@testing-library/react';
1818
import { useThemeOptions } from './useThemeOptions';
1919

2020
describe('useThemeOptions', () => {

workspaces/theme/yarn.lock

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5841,10 +5841,11 @@ __metadata:
58415841
"@backstage/e2e-test-utils": "npm:^0.1.2"
58425842
"@backstage/repo-tools": "npm:^0.17.0"
58435843
"@changesets/cli": "npm:^2.27.1"
5844-
"@jest/environment-jsdom-abstract": "npm:^30.0.0"
5844+
"@jest/environment-jsdom-abstract": "npm:^30.3.0"
58455845
"@playwright/test": "npm:1.59.1"
58465846
"@types/jest": "npm:^30.0.0"
5847-
jest: "npm:^30.2.0"
5847+
"@types/jsdom": "npm:^27.0.0"
5848+
jest: "npm:^30.3.0"
58485849
jsdom: "npm:^27.1.0"
58495850
knip: "npm:^5.27.4"
58505851
node-gyp: "npm:^9.0.0"
@@ -6072,7 +6073,7 @@ __metadata:
60726073
languageName: node
60736074
linkType: hard
60746075

6075-
"@jest/environment-jsdom-abstract@npm:^30.0.0":
6076+
"@jest/environment-jsdom-abstract@npm:^30.3.0":
60766077
version: 30.3.0
60776078
resolution: "@jest/environment-jsdom-abstract@npm:30.3.0"
60786079
dependencies:
@@ -11006,7 +11007,6 @@ __metadata:
1100611007
"@mui/icons-material": "npm:^5.17.1"
1100711008
"@testing-library/jest-dom": "npm:^6.0.0"
1100811009
"@testing-library/react": "npm:^14.0.0"
11009-
"@testing-library/react-hooks": "npm:^8.0.1"
1101011010
"@testing-library/user-event": "npm:^14.0.0"
1101111011
msw: "npm:^1.0.0"
1101211012
react: "npm:^16.13.1 || ^17.0.0 || ^18.0.0"
@@ -13444,28 +13444,6 @@ __metadata:
1344413444
languageName: node
1344513445
linkType: hard
1344613446

13447-
"@testing-library/react-hooks@npm:^8.0.1":
13448-
version: 8.0.1
13449-
resolution: "@testing-library/react-hooks@npm:8.0.1"
13450-
dependencies:
13451-
"@babel/runtime": "npm:^7.12.5"
13452-
react-error-boundary: "npm:^3.1.0"
13453-
peerDependencies:
13454-
"@types/react": ^16.9.0 || ^17.0.0
13455-
react: ^16.9.0 || ^17.0.0
13456-
react-dom: ^16.9.0 || ^17.0.0
13457-
react-test-renderer: ^16.9.0 || ^17.0.0
13458-
peerDependenciesMeta:
13459-
"@types/react":
13460-
optional: true
13461-
react-dom:
13462-
optional: true
13463-
react-test-renderer:
13464-
optional: true
13465-
checksum: 10c0/83bef2d4c437b84143213b5275ef00ef14e5bcd344f9ded12b162d253dc3c799138ead4428026b9c725e5a38dbebf611f2898aa43f3e43432bcaccbd7bf413e5
13466-
languageName: node
13467-
linkType: hard
13468-
1346913447
"@testing-library/react@npm:^14.0.0":
1347013448
version: 14.3.1
1347113449
resolution: "@testing-library/react@npm:14.3.1"
@@ -14005,6 +13983,17 @@ __metadata:
1400513983
languageName: node
1400613984
linkType: hard
1400713985

13986+
"@types/jsdom@npm:^27.0.0":
13987+
version: 27.0.0
13988+
resolution: "@types/jsdom@npm:27.0.0"
13989+
dependencies:
13990+
"@types/node": "npm:*"
13991+
"@types/tough-cookie": "npm:*"
13992+
parse5: "npm:^7.0.0"
13993+
checksum: 10c0/1ec7ff7177e1f7266e51279f07f3cd013e1713766b01eebceac783061675b31c672a47b0a508dcbaf040f7f22d90405858378c6c5358991989fbe8b95adde354
13994+
languageName: node
13995+
linkType: hard
13996+
1400813997
"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.11, @types/json-schema@npm:^7.0.15, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.6, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9":
1400913998
version: 7.0.15
1401013999
resolution: "@types/json-schema@npm:7.0.15"
@@ -23940,7 +23929,7 @@ __metadata:
2394023929
languageName: node
2394123930
linkType: hard
2394223931

23943-
"jest@npm:^30.2.0":
23932+
"jest@npm:^30.3.0":
2394423933
version: 30.3.0
2394523934
resolution: "jest@npm:30.3.0"
2394623935
dependencies:
@@ -29702,17 +29691,6 @@ __metadata:
2970229691
languageName: node
2970329692
linkType: hard
2970429693

29705-
"react-error-boundary@npm:^3.1.0":
29706-
version: 3.1.4
29707-
resolution: "react-error-boundary@npm:3.1.4"
29708-
dependencies:
29709-
"@babel/runtime": "npm:^7.12.5"
29710-
peerDependencies:
29711-
react: ">=16.13.1"
29712-
checksum: 10c0/f977ca61823e43de2381d53dd7aa8b4d79ff6a984c9afdc88dc44f9973b99de7fd382d2f0f91f2688e24bb987c0185bf45d0b004f22afaaab0f990a830253bfb
29713-
languageName: node
29714-
linkType: hard
29715-
2971629694
"react-error-boundary@npm:^4.1.2":
2971729695
version: 4.1.2
2971829696
resolution: "react-error-boundary@npm:4.1.2"

0 commit comments

Comments
 (0)