Skip to content

Commit e108624

Browse files
committed
feat: migrate Jest from v29 to v30
1 parent e7ef4a7 commit e108624

File tree

68 files changed

+1982
-848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1982
-848
lines changed

.yarnrc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ packageExtensions:
2121
"@types/express-serve-static-core": ^5.0.0
2222

2323
yarnPath: .yarn/releases/yarn-4.9.2.cjs
24+
25+
logFilters:
26+
# Filter of logs for jest and jest-environment-jsdom which don't satisfy what @angular-devkit/build-angular requests
27+
# TODO: remove this filter once @angular-devkit/build-angular updates to jest v30
28+
- pattern: (jest|jest-environment-jsdom) is listed by your project with version 30*, which doesn't satisfy what @angular-devkit/build-angular *
29+
level: discard
30+
# Filter of logs for jest, @jest/transform, and @jest/types which don't satisfy what ts-jest requests
31+
# TODO: remove this filter once ts-jest updates to jest v30
32+
- pattern: (jest|\@jest\/*) is listed by your project with version 30*, which doesn't satisfy what ts-jest *
33+
level: discard

apps/chrome-devtools/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@schematics/angular": "~20.0.0",
5151
"@stylistic/eslint-plugin": "~3.1.0",
5252
"@types/chrome": "^0.0.328",
53-
"@types/jest": "~29.5.2",
53+
"@types/jest": "~30.0.0",
5454
"@types/tinycolor2": "^1.4.6",
5555
"@typescript-eslint/parser": "~8.37.0",
5656
"angular-eslint": "~20.1.0",
@@ -70,11 +70,12 @@
7070
"eslint-plugin-unicorn": "~56.0.0",
7171
"eslint-plugin-unused-imports": "~4.1.4",
7272
"globals": "^15.9.0",
73-
"globby": "^11.1.0",
74-
"jest": "~29.7.0",
75-
"jest-environment-jsdom": "~29.7.0",
73+
"globby": "^14.1.0",
74+
"jest": "~30.0.0",
75+
"jest-environment-jsdom": "~30.0.0",
7676
"jest-junit": "~16.0.0",
77-
"jest-preset-angular": "~14.6.0",
77+
"jest-preset-angular": "~15.0.0",
78+
"jsdom": "^26.1.0",
7879
"jsonc-eslint-parser": "~2.4.0",
7980
"lighthouse": "~12.7.0",
8081
"minimist": "^1.2.6",

apps/github-cascading-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@stylistic/eslint-plugin": "~3.1.0",
4343
"@types/ejs": "^3.1.2",
4444
"@types/express-serve-static-core": "^5.0.0",
45-
"@types/jest": "~29.5.2",
45+
"@types/jest": "~30.0.0",
4646
"@types/node": "^20.0.0",
4747
"@types/semver": "^7.3.13",
4848
"@typescript-eslint/parser": "~8.37.0",
@@ -60,8 +60,8 @@
6060
"eslint-plugin-unicorn": "~56.0.0",
6161
"eslint-plugin-unused-imports": "~4.1.4",
6262
"globals": "^15.9.0",
63-
"jest": "~29.7.0",
64-
"jest-environment-jsdom": "~29.7.0",
63+
"jest": "~30.0.0",
64+
"jest-environment-jsdom": "~30.0.0",
6565
"jest-junit": "~16.0.0",
6666
"jsonc-eslint-parser": "~2.4.0",
6767
"nock": "^14.0.0",

apps/palette-generator/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@schematics/angular": "~20.0.0",
3030
"@stylistic/eslint-plugin": "~3.1.0",
3131
"@stylistic/eslint-plugin-ts": "~3.1.0",
32-
"@types/jest": "~29.5.2",
32+
"@types/jest": "~30.0.0",
3333
"@types/node": "^20.0.0",
3434
"@typescript-eslint/parser": "~8.37.0",
3535
"angular-eslint": "~20.1.0",
@@ -48,8 +48,8 @@
4848
"globals": "^15.9.0",
4949
"html-inline-script-webpack-plugin": "^3.1.0",
5050
"html-webpack-plugin": "^5.3.2",
51-
"jest": "~29.7.0",
52-
"jest-environment-jsdom": "~29.7.0",
51+
"jest": "~30.0.0",
52+
"jest-environment-jsdom": "~30.0.0",
5353
"jest-junit": "~16.0.0",
5454
"jsonc-eslint-parser": "~2.4.0",
5555
"style-loader": "^3.2.1",

apps/showcase/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@
8383
"bootstrap": "5.3.7",
8484
"clipboard": "^2.0.11",
8585
"globals": "^15.9.0",
86-
"globby": "^11.1.0",
86+
"globby": "^14.1.0",
8787
"intl-messageformat": "~10.7.0",
88-
"jest-preset-angular": "~14.6.0",
88+
"jest-preset-angular": "~15.0.0",
89+
"jsdom": "^26.1.0",
8990
"marked": "^15.0.6",
9091
"monaco-editor": "~0.52.0",
9192
"ngx-markdown": "^20.0.0",
@@ -124,7 +125,7 @@
124125
"@schematics/angular": "~20.0.0",
125126
"@stylistic/eslint-plugin": "~3.1.0",
126127
"@types/bootstrap": "^5.2.10",
127-
"@types/jest": "~29.5.2",
128+
"@types/jest": "~30.0.0",
128129
"@types/node": "^20.0.0",
129130
"@typescript-eslint/parser": "~8.37.0",
130131
"@webcontainer/api": "~1.6.0",
@@ -141,11 +142,12 @@
141142
"eslint-plugin-unicorn": "~56.0.0",
142143
"eslint-plugin-unused-imports": "~4.1.4",
143144
"globals": "^15.9.0",
144-
"globby": "^11.1.0",
145-
"jest": "~29.7.0",
146-
"jest-environment-jsdom": "~29.7.0",
145+
"globby": "^14.1.0",
146+
"jest": "~30.0.0",
147+
"jest-environment-jsdom": "~30.0.0",
147148
"jest-junit": "~16.0.0",
148-
"jest-preset-angular": "~14.6.0",
149+
"jest-preset-angular": "~15.0.0",
150+
"jsdom": "^26.1.0",
149151
"jsonc-eslint-parser": "~2.4.0",
150152
"lighthouse": "~12.7.0",
151153
"minimist": "^1.2.6",

apps/vscode-extension/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@
376376
"@stylistic/eslint-plugin": "~3.1.0",
377377
"@types/eslint": "~9.6.0",
378378
"@types/glob": "^8.0.0",
379-
"@types/jest": "~29.5.2",
379+
"@types/jest": "~30.0.0",
380380
"@types/node": "^20.0.0",
381381
"@types/vscode": "^1.100.0",
382382
"@typescript-eslint/parser": "~8.37.0",
@@ -395,8 +395,8 @@
395395
"eslint-plugin-unicorn": "~56.0.0",
396396
"eslint-plugin-unused-imports": "~4.1.4",
397397
"globals": "^15.9.0",
398-
"jest": "~29.7.0",
399-
"jest-environment-jsdom": "~29.7.0",
398+
"jest": "~30.0.0",
399+
"jest-environment-jsdom": "~30.0.0",
400400
"jest-junit": "~16.0.0",
401401
"jiti": "^2.4.0",
402402
"jsonc-eslint-parser": "~2.4.0",

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"resolutions": {
130130
"@sinonjs/fake-timers": "^14.0.0",
131131
"@types/node": "^20.19.0 || ^22.12.0 || ^24.0.0",
132+
"jest": "~30.0.0",
132133
"form-data": "^4.0.4",
133134
"koa": "~2.16.0",
134135
"rxjs": "^7.8.1",
@@ -206,7 +207,7 @@
206207
"@types/css-tree": "~2.3.0",
207208
"@types/eslint": "~9.6.0",
208209
"@types/estree": "^1.0.5",
209-
"@types/jest": "~29.5.2",
210+
"@types/jest": "~30.0.0",
210211
"@types/node": "^20.0.0",
211212
"@types/semver": "^7.3.13",
212213
"@typescript-eslint/parser": "~8.37.0",
@@ -240,14 +241,15 @@
240241
"eslint-plugin-unicorn": "~56.0.0",
241242
"eslint-plugin-unused-imports": "~4.1.4",
242243
"globals": "^15.9.0",
243-
"globby": "^11.1.0",
244+
"globby": "^14.1.0",
244245
"husky": "~9.1.0",
245246
"intl-messageformat": "~10.7.0",
246247
"isomorphic-fetch": "~3.0.0",
247-
"jest": "~29.7.0",
248-
"jest-environment-jsdom": "~29.7.0",
249-
"jest-preset-angular": "~14.6.0",
248+
"jest": "~30.0.0",
249+
"jest-environment-jsdom": "~30.0.0",
250+
"jest-preset-angular": "~15.0.0",
250251
"js-yaml": "^4.1.0",
252+
"jsdom": "^26.1.0",
251253
"jsonc-eslint-parser": "~2.4.0",
252254
"jsonpath-plus": "~10.3.0",
253255
"lighthouse": "~12.7.0",

packages/@ama-mfe/messages/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@stylistic/eslint-plugin-ts": "~3.1.0",
5454
"@swc/cli": "~0.7.7",
5555
"@swc/core": "~1.12.0",
56-
"@types/jest": "~29.5.2",
56+
"@types/jest": "~30.0.0",
5757
"@types/node": "^20.0.0",
5858
"@typescript-eslint/parser": "~8.37.0",
5959
"cpy-cli": "^5.0.0",
@@ -67,7 +67,7 @@
6767
"eslint-plugin-prefer-arrow": "~1.2.3",
6868
"eslint-plugin-unicorn": "~56.0.0",
6969
"eslint-plugin-unused-imports": "~4.1.4",
70-
"jest": "~29.7.0",
70+
"jest": "~30.0.0",
7171
"jest-junit": "~16.0.0",
7272
"jsonc-eslint-parser": "~2.4.0",
7373
"minimist": "^1.2.6",

packages/@ama-mfe/ng-utils/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@
5151
"@angular/platform-browser-dynamic": "~20.0.0",
5252
"@angular/router": "~20.0.0",
5353
"@compodoc/compodoc": "^1.1.19",
54+
"@jest/environment-jsdom-abstract": "~30.0.0",
5455
"@o3r/build-helpers": "workspace:^",
5556
"@o3r/eslint-config": "workspace:^",
5657
"@o3r/eslint-plugin": "workspace:^",
5758
"@o3r/test-helpers": "workspace:^",
5859
"@schematics/angular": "~20.0.0",
59-
"@types/jest": "~29.5.2",
60+
"@types/jest": "~30.0.0",
6061
"@types/jsdom": "^21.1.7",
6162
"@types/node": "^20.0.0",
6263
"cpy-cli": "^5.0.0",
@@ -71,11 +72,10 @@
7172
"eslint-plugin-unicorn": "~56.0.0",
7273
"eslint-plugin-unused-imports": "~4.1.4",
7374
"globals": "^15.9.0",
74-
"globby": "^11.1.0",
75-
"jest": "~29.7.0",
76-
"jest-environment-jsdom": "~29.7.0",
75+
"globby": "^14.1.0",
76+
"jest": "~30.0.0",
7777
"jest-junit": "~16.0.0",
78-
"jest-preset-angular": "~14.6.0",
78+
"jest-preset-angular": "~15.0.0",
7979
"jsdom": "^26.1.0",
8080
"jsonc-eslint-parser": "~2.4.0",
8181
"rxjs": "^7.8.1",

packages/@ama-mfe/ng-utils/src/navigation/restore-route.pipe.spec.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ describe('RestoreRoute', () => {
2424
let sanitizer: DomSanitizer;
2525
let routeMemorizeService: RouteMemorizeService;
2626
let activatedRoute: ActivatedRoute;
27+
let mockWindow: { location: { href: string }; origin?: string };
2728

2829
beforeEach(() => {
30+
mockWindow = { location: { href: window.location.href } };
2931
const routeMemorizeServiceMock = {
3032
getRoute: jest.fn(),
3133
memorizeRoute: jest.fn(() => {})
@@ -40,6 +42,7 @@ describe('RestoreRoute', () => {
4042
});
4143

4244
pipe = TestBed.inject(RestoreRoute);
45+
(pipe as any).window = mockWindow; // Inject the mock window into the pipe
4346
sanitizer = TestBed.inject(DomSanitizer);
4447
routeMemorizeService = TestBed.inject(RouteMemorizeService);
4548
activatedRoute = TestBed.inject(ActivatedRoute);
@@ -74,7 +77,7 @@ describe('RestoreRoute', () => {
7477
const options: RestoreRouteOptions = { propagateQueryParams: true };
7578
jest.spyOn(sanitizer, 'sanitize').mockReturnValue(url);
7679

77-
Object.defineProperty(window, 'location', {
80+
Object.defineProperty(mockWindow, 'location', {
7881
value: { href: 'http://example-top-window.com?param2=value2' },
7982
writable: true
8083
});
@@ -89,7 +92,7 @@ describe('RestoreRoute', () => {
8992
const options: RestoreRouteOptions = { propagateQueryParams: true };
9093
jest.spyOn(sanitizer, 'sanitize').mockReturnValue(url);
9194

92-
Object.defineProperty(window, 'location', {
95+
Object.defineProperty(mockWindow, 'location', {
9396
value: { href: 'http://example-top-window.com?param2=value2' },
9497
writable: true
9598
});
@@ -103,7 +106,7 @@ describe('RestoreRoute', () => {
103106
const url = 'http://example.com?param1=value1';
104107
const options: RestoreRouteOptions = { propagateQueryParams: true, overrideQueryParams: true };
105108
jest.spyOn(sanitizer, 'sanitize').mockReturnValue(url);
106-
Object.defineProperty(window, 'location', {
109+
Object.defineProperty(mockWindow, 'location', {
107110
value: { href: 'http://example-to-window.com?param1=value2' },
108111
writable: true
109112
});
@@ -116,7 +119,7 @@ describe('RestoreRoute', () => {
116119
it('should append the correct pathname and remove the module path from top window url', () => {
117120
const url = 'http://example.com';
118121
jest.spyOn(sanitizer, 'sanitize').mockReturnValue(url);
119-
Object.defineProperty(window, 'location', {
122+
Object.defineProperty(mockWindow, 'location', {
120123
value: { href: 'http://example-top-window.com/module-path/in-module-path' },
121124
writable: true
122125
});
@@ -131,7 +134,7 @@ describe('RestoreRoute', () => {
131134
const url = 'http://example.com';
132135
jest.spyOn(sanitizer, 'sanitize').mockReturnValue(url);
133136

134-
Object.defineProperty(window, 'origin', {
137+
Object.defineProperty(mockWindow, 'origin', {
135138
value: 'http://example-top-window.com'
136139
});
137140

0 commit comments

Comments
 (0)