Skip to content

Commit 55ded00

Browse files
feat: update to Angular v22 (#581)
1 parent 6140280 commit 55ded00

18 files changed

Lines changed: 105 additions & 43 deletions

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
registry=https://registry.npmjs.org/
22
package-lock=false
3+
legacy-peer-deps=true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ You may also be interested in installing `jest-dom` so you can use
179179

180180
| Angular | Angular Testing Library |
181181
| ------- | ---------------------------------- |
182+
| 22.x | 19.x |
182183
| 21.x | 19.x |
183184
| 20.x | 18.x, 17.x, 16.x, 15.x, 14.x, 13.x |
184185
| 19.x | 17.x, 16.x, 15.x, 14.x, 13.x |

apps/example-app-jest/tsconfig.app.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@
99
},
1010
"files": ["src/main.ts"],
1111
"include": ["src/**/*.d.ts"],
12-
"exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"]
12+
"exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"],
13+
"angularCompilerOptions": {
14+
"extendedDiagnostics": {
15+
"checks": {
16+
"nullishCoalescingNotNullable": "suppress",
17+
"optionalChainNotNullable": "suppress"
18+
}
19+
}
20+
}
1321
}

apps/example-app-karma/src/app/issues/issue-491.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, inject } from '@angular/core';
1+
import { Component, inject, ChangeDetectionStrategy } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { render, screen } from '@testing-library/angular';
44
import userEvent from '@testing-library/user-event';
@@ -35,6 +35,7 @@ it('test click event with router.navigate', async () => {
3535
});
3636

3737
@Component({
38+
changeDetection: ChangeDetectionStrategy.Eager,
3839
template: `
3940
<h1>Login</h1>
4041
<button type="submit" (click)="onSubmit()">submit</button>
@@ -50,6 +51,7 @@ class LoginComponent {
5051
}
5152

5253
@Component({
54+
changeDetection: ChangeDetectionStrategy.Eager,
5355
template: ` <h1>Logged In</h1> `,
5456
})
5557
class LoggedInComponent {}

apps/example-app-karma/tsconfig.app.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@
99
},
1010
"files": ["src/main.ts"],
1111
"include": ["src/**/*.d.ts"],
12-
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
12+
"exclude": ["**/*.test.ts", "**/*.spec.ts"],
13+
"angularCompilerOptions": {
14+
"extendedDiagnostics": {
15+
"checks": {
16+
"nullishCoalescingNotNullable": "suppress",
17+
"optionalChainNotNullable": "suppress"
18+
}
19+
}
20+
}
1321
}

apps/example-app-karma/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"compilerOptions": {
66
"target": "es2020",
77
"paths": {
8-
"@testing-library/angular": ["projects/testing-library"]
8+
"@testing-library/angular": ["./../../projects/testing-library"]
99
}
1010
},
1111
"angularCompilerOptions": {

apps/example-app-karma/tsconfig.spec.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@
77
"useDefineForClassFields": false
88
},
99
"files": ["src/test.ts"],
10-
"include": ["**/*.spec.ts", "**/*.d.ts"]
10+
"include": ["**/*.spec.ts", "**/*.d.ts"],
11+
"angularCompilerOptions": {
12+
"extendedDiagnostics": {
13+
"checks": {
14+
"nullishCoalescingNotNullable": "suppress",
15+
"optionalChainNotNullable": "suppress"
16+
}
17+
}
18+
}
1119
}

apps/example-app/tsconfig.app.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@
99
},
1010
"files": ["src/main.ts"],
1111
"include": ["src/**/*.d.ts"],
12-
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
12+
"exclude": ["**/*.test.ts", "**/*.spec.ts"],
13+
"angularCompilerOptions": {
14+
"extendedDiagnostics": {
15+
"checks": {
16+
"nullishCoalescingNotNullable": "suppress",
17+
"optionalChainNotNullable": "suppress"
18+
}
19+
}
20+
}
1321
}

apps/example-app/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"compilerOptions": {
66
"target": "es2020",
77
"paths": {
8-
"@testing-library/angular": ["projects/testing-library"],
9-
"@testing-library/angular/vitest-utils": ["projects/testing-library/vitest-utils"]
8+
"@testing-library/angular": ["./../../projects/testing-library"],
9+
"@testing-library/angular/vitest-utils": ["./../../projects/testing-library/vitest-utils"]
1010
}
1111
},
1212
"angularCompilerOptions": {

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,37 @@
2020
"prepare": "git config core.hookspath .githooks"
2121
},
2222
"dependencies": {
23-
"@angular/animations": "21.0.5",
24-
"@angular/cdk": "21.0.3",
25-
"@angular/common": "21.0.5",
26-
"@angular/compiler": "21.0.5",
27-
"@angular/core": "21.0.5",
28-
"@angular/material": "21.0.3",
29-
"@angular/platform-browser": "21.0.5",
30-
"@angular/platform-browser-dynamic": "21.0.5",
31-
"@angular/router": "21.0.5",
32-
"@ngrx/store": "20.0.0",
23+
"@angular/animations": "22.0.0",
24+
"@angular/cdk": "22.0.0",
25+
"@angular/common": "22.0.0",
26+
"@angular/compiler": "22.0.0",
27+
"@angular/core": "22.0.0",
28+
"@angular/material": "22.0.0",
29+
"@angular/platform-browser": "22.0.0",
30+
"@angular/platform-browser-dynamic": "22.0.0",
31+
"@angular/router": "22.0.0",
32+
"@ngrx/store": "21.1.0",
3333
"@testing-library/dom": "^10.4.1",
3434
"rxjs": "7.8.0",
3535
"tslib": "~2.8.1",
3636
"zone.js": "^0.15.1"
3737
},
3838
"devDependencies": {
3939
"@angular-builders/jest": "^20.0.0",
40-
"@angular-devkit/core": "21.0.3",
41-
"@angular-devkit/schematics": "21.0.3",
40+
"@angular-devkit/core": "22.0.0",
41+
"@angular-devkit/schematics": "22.0.0",
4242
"@angular-eslint/builder": "21.1.0",
4343
"@angular-eslint/eslint-plugin": "21.1.0",
4444
"@angular-eslint/eslint-plugin-template": "21.1.0",
4545
"@angular-eslint/schematics": "21.1.0",
4646
"@angular-eslint/template-parser": "21.1.0",
47-
"@angular/build": "^21.0.3",
48-
"@angular/cli": "~21.0.3",
49-
"@angular/compiler-cli": "21.0.5",
50-
"@angular/forms": "21.0.5",
51-
"@angular/language-service": "21.0.5",
47+
"@angular/build": "^22.0.0",
48+
"@angular/cli": "~22.0.0",
49+
"@angular/compiler-cli": "22.0.0",
50+
"@angular/forms": "22.0.0",
51+
"@angular/language-service": "22.0.0",
5252
"@eslint/eslintrc": "^3.3.1",
53-
"@schematics/angular": "21.0.3",
53+
"@schematics/angular": "22.0.0",
5454
"@testing-library/jasmine-dom": "^1.3.3",
5555
"@testing-library/jest-dom": "^6.9.1",
5656
"@testing-library/user-event": "^14.6.1",
@@ -66,6 +66,7 @@
6666
"eslint": "^9.39.1",
6767
"eslint-plugin-jest-dom": "~5.5.0",
6868
"eslint-plugin-testing-library": "~7.13.3",
69+
"istanbul-lib-instrument": "^6.0.3",
6970
"jasmine-core": "4.2.0",
7071
"jasmine-spec-reporter": "7.0.0",
7172
"jest": "30.2.0",
@@ -78,10 +79,10 @@
7879
"karma-jasmine-html-reporter": "2.0.0",
7980
"lint-staged": "^16.2.6",
8081
"ng-mocks": "^14.14.0",
81-
"ng-packagr": "21.0.0",
82+
"ng-packagr": "22.0.0",
8283
"prettier": "2.6.2",
8384
"rimraf": "^6.1.0",
84-
"typescript": "5.9.3",
85+
"typescript": "6.0.3",
8586
"typescript-eslint": "^8.46.3",
8687
"vitest": "4.0.15"
8788
}

0 commit comments

Comments
 (0)