Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 12184a8

Browse files
feat: upgrade to Angular 11 (testing-library#168)
1 parent e9e6b14 commit 12184a8

18 files changed

+13714
-116
lines changed

‎angular.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"optimization": true,
4141
"outputHashing": "all",
4242
"sourceMap": false,
43-
"extractCss": true,
4443
"namedChunks": false,
4544
"aot": true,
4645
"extractLicenses": true,
@@ -90,7 +89,7 @@
9089
"prefix": "lib",
9190
"architect": {
9291
"build-package": {
93-
"builder": "@angular-devkit/build-ng-packagr:build",
92+
"builder": "@angular-devkit/build-angular:ng-packagr",
9493
"options": {
9594
"tsConfig": "projects/testing-library/tsconfig.lib.json",
9695
"project": "projects/testing-library/ng-package.json"
@@ -146,7 +145,7 @@
146145
"prefix": "lib",
147146
"architect": {
148147
"build-package": {
149-
"builder": "@angular-devkit/build-ng-packagr:build",
148+
"builder": "@angular-devkit/build-angular:ng-packagr",
150149
"options": {
151150
"tsConfig": "projects/jest-utils/tsconfig.lib.json",
152151
"project": "projects/jest-utils/ng-package.json"

‎apps/example-app/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const routes: Routes = [
9595
];
9696

9797
@NgModule({
98-
imports: [RouterModule.forRoot(routes)],
98+
imports: [RouterModule.forRoot(routes,{relativeLinkResolution: 'legacy'})],
9999
exports: [RouterModule],
100100
})
101101
export class AppRoutingModule {}

‎apps/example-app/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = {
44
name: 'Example',
55
color: 'blue',
66
},
7-
preset: '../../jest.config.js',
7+
preset: '../../jest.preset.js',
88
};

‎apps/example-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
55
"types": [],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"module": "commonjs",
55
"types": ["node", "jest"]

‎jest.config.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
11
module.exports = {
2-
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
3-
transform: {
4-
'^.+\\.(ts|js|html)$': 'ts-jest',
5-
},
6-
resolver: '@nrwl/jest/plugins/resolver',
7-
moduleFileExtensions: ['ts', 'js', 'html'],
8-
coverageReporters: ['html'],
9-
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
10-
snapshotSerializers: [
11-
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
12-
'jest-preset-angular/build/AngularSnapshotSerializer.js',
13-
'jest-preset-angular/build/HTMLCommentSerializer.js',
14-
],
15-
globals: {
16-
'ts-jest': {
17-
tsconfig: '<rootDir>/tsconfig.spec.json',
18-
stringifyContentPathRegex: '\\.(html|svg)$',
19-
astTransformers: {
20-
before: [
21-
'jest-preset-angular/build/InlineFilesTransformer',
22-
'jest-preset-angular/build/StripStylesTransformer',
23-
]
24-
},
25-
},
26-
},
2+
projects: ['<rootDir>/', '<rootDir>/projects/testing-library', '<rootDir>/projects/jest-utils'],
273
};

‎jest.preset.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const nxPreset = require('@nrwl/jest/preset');
2+
module.exports = {
3+
...nxPreset,
4+
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
5+
transform: {
6+
'^.+\\.(ts|js|html)$': 'ts-jest',
7+
},
8+
resolver: '@nrwl/jest/plugins/resolver',
9+
moduleFileExtensions: ['ts', 'js', 'html'],
10+
coverageReporters: ['html'],
11+
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
12+
snapshotSerializers: [
13+
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
14+
'jest-preset-angular/build/AngularSnapshotSerializer.js',
15+
'jest-preset-angular/build/HTMLCommentSerializer.js',
16+
],
17+
globals: {
18+
'ts-jest': {
19+
tsconfig: '<rootDir>/tsconfig.spec.json',
20+
stringifyContentPathRegex: '\\.(html|svg)$',
21+
astTransformers: {
22+
before: [
23+
'jest-preset-angular/build/InlineFilesTransformer',
24+
'jest-preset-angular/build/StripStylesTransformer',
25+
],
26+
},
27+
},
28+
},
29+
};

‎package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
"semantic-release": "semantic-release"
2121
},
2222
"dependencies": {
23-
"@angular/animations": "^10.0.0",
24-
"@angular/cdk": "^10.0.0",
25-
"@angular/common": "^10.0.0",
26-
"@angular/compiler": "^10.0.0",
27-
"@angular/core": "^10.0.0",
28-
"@angular/forms": "^10.0.0",
29-
"@angular/material": "^10.0.0",
30-
"@angular/platform-browser": "^10.0.0",
31-
"@angular/platform-browser-dynamic": "^10.0.0",
32-
"@angular/router": "^10.0.0",
33-
"@ngrx/store": "^9.2.0",
34-
"@nrwl/angular": "^10.0.0",
23+
"@angular/animations": "^11.0.0",
24+
"@angular/cdk": "^11.0.0",
25+
"@angular/common": "^11.0.0",
26+
"@angular/compiler": "^11.0.0",
27+
"@angular/core": "^11.0.0",
28+
"@angular/forms": "^11.0.0",
29+
"@angular/material": "^11.0.0",
30+
"@angular/platform-browser": "^11.0.0",
31+
"@angular/platform-browser-dynamic": "^11.0.0",
32+
"@angular/router": "^11.0.0",
33+
"@ngrx/store": "^10.0.1",
34+
"@nrwl/angular": "^10.3.3",
3535
"@nrwl/nx-cloud": "^10.0.0",
3636
"@phenomnomnominal/tsquery": "^4.1.1",
3737
"@testing-library/dom": "^7.24.1",
@@ -43,30 +43,30 @@
4343
"zone.js": "~0.10.3"
4444
},
4545
"devDependencies": {
46-
"@angular-devkit/build-angular": "~0.1000.0",
47-
"@angular-devkit/build-ng-packagr": "~0.1000.0",
48-
"@angular/cli": "~10.0.0",
49-
"@angular/compiler-cli": "^10.0.0",
50-
"@angular/language-service": "^10.0.0",
51-
"@nrwl/jest": "^10.0.0",
52-
"@nrwl/node": "^10.0.0",
53-
"@nrwl/nx-plugin": "^10.0.0",
54-
"@nrwl/workspace": "^10.0.0",
46+
"@angular-devkit/build-angular": "~0.1100.0",
47+
"@angular/cli": "~11.0.0",
48+
"@angular/compiler-cli": "^11.0.0",
49+
"@angular/language-service": "^11.0.0",
50+
"@nrwl/cli": "10.3.3",
51+
"@nrwl/jest": "^10.3.3",
52+
"@nrwl/node": "^10.3.3",
53+
"@nrwl/nx-plugin": "^10.3.3",
54+
"@nrwl/workspace": "^10.3.3",
5555
"@testing-library/jest-dom": "^5.11.0",
5656
"@types/jest": "~26.0.3",
5757
"@types/node": "^14.0.14",
5858
"codelyzer": "^5.2.2",
5959
"cpy-cli": "^3.1.1",
6060
"husky": "^4.2.5",
6161
"jest": "^26.1.0",
62-
"jest-preset-angular": "^8.2.1",
62+
"jest-preset-angular": "8.3.1",
6363
"lint-staged": "^10.2.11",
64-
"ng-packagr": "^10.0.0",
64+
"ng-packagr": "^11.0.1",
6565
"prettier": "^2.0.5",
6666
"rimraf": "^3.0.2",
6767
"semantic-release": "^17.1.1",
68-
"ts-jest": "^26.1.1",
68+
"ts-jest": "26.4.0",
6969
"ts-node": "~8.10.2",
70-
"typescript": "~3.9.5"
70+
"typescript": "~4.0.5"
7171
}
7272
}

‎projects/jest-utils/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = {
44
name: 'JEST UTILS',
55
color: 'magenta',
66
},
7-
preset: '../../jest.config.js',
7+
preset: '../../jest.preset.js',
88
};

‎projects/jest-utils/tsconfig.lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../out-tsc/lib",
55
"target": "es2015",
6+
"declarationMap": false,
67
"module": "es2015",
78
"moduleResolution": "node",
89
"declaration": true,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /