Skip to content

Commit 20d47e7

Browse files
christopherthielenmergify[bot]
authored andcommitted
test: Add test for typescript4.0, angular 11, remove test for angular 9
1 parent 308d2af commit 20d47e7

40 files changed

+232
-276
lines changed

downstream_projects.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"packageDir": "./dist",
33
"projects": {
4-
"angular9": "./test-angular-versions/v9",
54
"angular10": "./test-angular-versions/v10",
5+
"angular11": "./test-angular-versions/v11",
66
"typescript3.6": "./test-typescript-versions/typescript3.6",
77
"typescript3.7": "./test-typescript-versions/typescript3.7",
88
"typescript3.8": "./test-typescript-versions/typescript3.8",
99
"typescript3.9": "./test-typescript-versions/typescript3.9",
10+
"typescript4.0": "./test-typescript-versions/typescript4.0",
1011
"sample-app-angular": "https://github.com/ui-router/sample-app-angular.git"
1112
}
1213
}

test-angular-versions/v10/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
"tslint": "~6.1.0",
4949
"typescript": "~3.9.6"
5050
}
51-
}
51+
}
File renamed without changes.

test-angular-versions/v9/angular.json renamed to test-angular-versions/v11/angular.json

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3-
"version": 1,
3+
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
66
"v9": {
@@ -19,13 +19,8 @@
1919
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "tsconfig.app.json",
2121
"aot": true,
22-
"assets": [
23-
"src/favicon.ico",
24-
"src/assets"
25-
],
26-
"styles": [
27-
"src/styles.css"
28-
],
22+
"assets": ["src/favicon.ico", "src/assets"],
23+
"styles": ["src/styles.css"],
2924
"scripts": []
3025
},
3126
"configurations": {
@@ -39,7 +34,6 @@
3934
"optimization": true,
4035
"outputHashing": "all",
4136
"sourceMap": false,
42-
"extractCss": true,
4337
"namedChunks": false,
4438
"extractLicenses": true,
4539
"vendorChunk": false,
@@ -83,27 +77,16 @@
8377
"polyfills": "src/polyfills.ts",
8478
"tsConfig": "tsconfig.spec.json",
8579
"karmaConfig": "karma.conf.js",
86-
"assets": [
87-
"src/favicon.ico",
88-
"src/assets"
89-
],
90-
"styles": [
91-
"src/styles.css"
92-
],
80+
"assets": ["src/favicon.ico", "src/assets"],
81+
"styles": ["src/styles.css"],
9382
"scripts": []
9483
}
9584
},
9685
"lint": {
9786
"builder": "@angular-devkit/build-angular:tslint",
9887
"options": {
99-
"tsConfig": [
100-
"tsconfig.app.json",
101-
"tsconfig.spec.json",
102-
"e2e/tsconfig.json"
103-
],
104-
"exclude": [
105-
"**/node_modules/**"
106-
]
88+
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
89+
"exclude": ["**/node_modules/**"]
10790
}
10891
},
10992
"e2e": {
@@ -119,6 +102,10 @@
119102
}
120103
}
121104
}
122-
}},
123-
"defaultProject": "v9"
105+
}
106+
},
107+
"defaultProject": "v9",
108+
"cli": {
109+
"analytics": false
110+
}
124111
}

test-angular-versions/v9/cypress/integration/sample_app_spec.js renamed to test-angular-versions/v11/cypress/integration/sample_app_spec.js

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,69 +23,45 @@ describe('Angular v9 app', () => {
2323

2424
it('renders home', () => {
2525
cy.visit('/home');
26-
cy.get('a')
27-
.contains('home')
28-
.should('have.class', 'active');
29-
cy.get('a')
30-
.contains('about')
31-
.should('not.have.class', 'active');
26+
cy.get('a').contains('home').should('have.class', 'active');
27+
cy.get('a').contains('about').should('not.have.class', 'active');
3228
cy.get('#default').contains('home works');
3329
});
3430

3531
it('renders about', () => {
3632
cy.visit('/home');
3733
cy.visit('/about');
38-
cy.get('a')
39-
.contains('home')
40-
.should('not.have.class', 'active');
41-
cy.get('a')
42-
.contains('about')
43-
.should('have.class', 'active');
34+
cy.get('a').contains('home').should('not.have.class', 'active');
35+
cy.get('a').contains('about').should('have.class', 'active');
4436
cy.get('#default').contains('about works');
4537
});
4638

4739
it('loads lazy routes', () => {
4840
cy.visit('/home');
4941
cy.visit('/lazy');
50-
cy.get('a')
51-
.contains('home')
52-
.should('not.have.class', 'active');
53-
cy.get('a')
54-
.contains('lazy')
55-
.should('have.class', 'active');
42+
cy.get('a').contains('home').should('not.have.class', 'active');
43+
cy.get('a').contains('lazy').should('have.class', 'active');
5644
cy.get('#default').contains('lazy works');
5745
});
5846

5947
it('routes to lazy routes', () => {
6048
cy.visit('/lazy');
61-
cy.get('a')
62-
.contains('home')
63-
.should('not.have.class', 'active');
64-
cy.get('a')
65-
.contains('lazy')
66-
.should('have.class', 'active');
49+
cy.get('a').contains('home').should('not.have.class', 'active');
50+
cy.get('a').contains('lazy').should('have.class', 'active');
6751
cy.get('#default').contains('lazy works');
6852
});
6953

7054
it('routes to lazy child routes', () => {
7155
cy.visit('/lazy/child');
72-
cy.get('a')
73-
.contains('home')
74-
.should('not.have.class', 'active');
75-
cy.get('a')
76-
.contains('lazy.child')
77-
.should('have.class', 'active');
56+
cy.get('a').contains('home').should('not.have.class', 'active');
57+
cy.get('a').contains('lazy.child').should('have.class', 'active');
7858
cy.get('#default').contains('lazy.child works');
7959
});
8060

8161
it('targets named views', () => {
8262
cy.visit('/lazy/child/viewtarget');
83-
cy.get('a')
84-
.contains('home')
85-
.should('not.have.class', 'active');
86-
cy.get('a')
87-
.contains('lazy.child')
88-
.should('have.class', 'active');
63+
cy.get('a').contains('home').should('not.have.class', 'active');
64+
cy.get('a').contains('lazy.child').should('have.class', 'active');
8965
cy.get('#default').contains('lazy.child works');
9066
cy.get('#header').contains('lazy.child.viewtarget works');
9167
cy.get('#footer').contains('lazy.child.viewtarget works');

test-angular-versions/v9/karma.conf.js renamed to test-angular-versions/v11/karma.conf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ module.exports = function (config) {
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage-istanbul-reporter'),
13-
require('@angular-devkit/build-angular/plugins/karma')
13+
require('@angular-devkit/build-angular/plugins/karma'),
1414
],
1515
client: {
16-
clearContext: false // leave Jasmine Spec Runner output visible in browser
16+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
1717
},
1818
coverageIstanbulReporter: {
1919
dir: require('path').join(__dirname, './coverage/v9'),
2020
reports: ['html', 'lcovonly', 'text-summary'],
21-
fixWebpackSourcePaths: true
21+
fixWebpackSourcePaths: true,
2222
},
2323
reporters: ['progress', 'kjhtml'],
2424
port: 9876,
@@ -27,6 +27,6 @@ module.exports = function (config) {
2727
autoWatch: true,
2828
browsers: ['Chrome'],
2929
singleRun: false,
30-
restartOnFileChange: true
30+
restartOnFileChange: true,
3131
});
3232
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "v9",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "npm run test:dev && npm run test:prod",
9+
"test:dev": "ng build && cypress-runner run --path dist/v9",
10+
"test:prod": "ng build --prod && cypress-runner run --path dist/v9",
11+
"lint": "ng lint",
12+
"e2e": "ng e2e"
13+
},
14+
"private": true,
15+
"dependencies": {
16+
"@angular/animations": "~11.0.5",
17+
"@angular/common": "~11.0.5",
18+
"@angular/compiler": "~11.0.5",
19+
"@angular/core": "~11.0.5",
20+
"@angular/forms": "~11.0.5",
21+
"@angular/platform-browser": "~11.0.5",
22+
"@angular/platform-browser-dynamic": "~11.0.5",
23+
"@angular/router": "~11.0.5",
24+
"@uirouter/cypress-runner": "^1.0.10",
25+
"@uirouter/angular": "latest",
26+
"rxjs": "~6.5.4",
27+
"tslib": "^2.0.0",
28+
"zone.js": "~0.10.3"
29+
},
30+
"devDependencies": {
31+
"@angular-devkit/build-angular": "~0.1100.5",
32+
"@angular/cli": "~11.0.5",
33+
"@angular/compiler-cli": "~11.0.5",
34+
"@angular/language-service": "~11.0.5",
35+
"@types/node": "^12.11.1",
36+
"@types/jasmine": "~3.6.0",
37+
"@types/jasminewd2": "~2.0.3",
38+
"jasmine-core": "~3.6.0",
39+
"jasmine-spec-reporter": "~5.0.0",
40+
"karma": "~5.0.0",
41+
"karma-chrome-launcher": "~3.1.0",
42+
"karma-coverage-istanbul-reporter": "~3.0.2",
43+
"karma-jasmine": "~4.0.0",
44+
"karma-jasmine-html-reporter": "^1.5.0",
45+
"protractor": "~7.0.0",
46+
"ts-node": "~8.3.0",
47+
"tslint": "~6.1.0",
48+
"typescript": "~4.0.5"
49+
}
50+
}

test-angular-versions/v9/src/app/about.component.ts renamed to test-angular-versions/v11/src/app/about.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'app-about',
5-
template: `
6-
<p>about works!</p>
7-
`,
5+
template: ` <p>about works!</p> `,
86
})
97
export class AboutComponent {}

0 commit comments

Comments
 (0)