Skip to content

Commit 6cf9887

Browse files
alan-agius4dgp1130
authored andcommitted
test(@angular/cli): update ng-update test to start from version 10
With this change we update the `ng-update` test to start from version 10 as version 9 has been out of support for some time now.
1 parent c95ab70 commit 6cf9887

33 files changed

+176
-99
lines changed

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
.yarn/
1313
dist/
1414
third_party/
15-
/tests/legacy-cli/e2e/assets/9.0-project/
15+
/tests/legacy-cli/e2e/assets/
1616
/tools/test/*.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
18+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

tests/legacy-cli/e2e/assets/9.0-project/README.md renamed to tests/legacy-cli/e2e/assets/10.0-project/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# NineProject
1+
# TenProject
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.15.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.2.4.
44

55
## Development server
66

@@ -24,4 +24,4 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac
2424

2525
## Further help
2626

27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

tests/legacy-cli/e2e/assets/9.0-project/angular.json renamed to tests/legacy-cli/e2e/assets/10.0-project/angular.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"nine-project": {
6+
"ten-project": {
77
"projectType": "application",
88
"schematics": {},
99
"root": "",
@@ -13,7 +13,7 @@
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
1515
"options": {
16-
"outputPath": "dist/nine-project",
16+
"outputPath": "dist/ten-project",
1717
"index": "src/index.html",
1818
"main": "src/main.ts",
1919
"polyfills": "src/polyfills.ts",
@@ -57,18 +57,18 @@
5757
"serve": {
5858
"builder": "@angular-devkit/build-angular:dev-server",
5959
"options": {
60-
"browserTarget": "nine-project:build"
60+
"browserTarget": "ten-project:build"
6161
},
6262
"configurations": {
6363
"production": {
64-
"browserTarget": "nine-project:build:production"
64+
"browserTarget": "ten-project:build:production"
6565
}
6666
}
6767
},
6868
"extract-i18n": {
6969
"builder": "@angular-devkit/build-angular:extract-i18n",
7070
"options": {
71-
"browserTarget": "nine-project:build"
71+
"browserTarget": "ten-project:build"
7272
}
7373
},
7474
"test": {
@@ -94,16 +94,16 @@
9494
"builder": "@angular-devkit/build-angular:protractor",
9595
"options": {
9696
"protractorConfig": "e2e/protractor.conf.js",
97-
"devServerTarget": "nine-project:serve"
97+
"devServerTarget": "ten-project:serve"
9898
},
9999
"configurations": {
100100
"production": {
101-
"devServerTarget": "nine-project:serve:production"
101+
"devServerTarget": "ten-project:serve:production"
102102
}
103103
}
104104
}
105105
}
106106
}
107107
},
108-
"defaultProject": "nine-project"
108+
"defaultProject": "ten-project"
109109
}

tests/legacy-cli/e2e/assets/9.0-project/e2e/protractor.conf.js renamed to tests/legacy-cli/e2e/assets/10.0-project/e2e/protractor.conf.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Protractor configuration file, see link for more information
33
// https://github.com/angular/protractor/blob/master/lib/config.ts
44

5-
const { SpecReporter } = require('jasmine-spec-reporter');
5+
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
66

77
/**
88
* @type { import("protractor").Config }
@@ -25,6 +25,12 @@ exports.config = {
2525
require('ts-node').register({
2626
project: require('path').join(__dirname, './tsconfig.json'),
2727
});
28-
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
28+
jasmine.getEnv().addReporter(
29+
new SpecReporter({
30+
spec: {
31+
displayStacktrace: StacktraceOption.PRETTY,
32+
},
33+
}),
34+
);
2935
},
3036
};

tests/legacy-cli/e2e/assets/9.0-project/e2e/src/app.e2e-spec.ts renamed to tests/legacy-cli/e2e/assets/10.0-project/e2e/src/app.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('workspace-project App', () => {
1010

1111
it('should display welcome message', () => {
1212
page.navigateTo();
13-
expect(page.getTitleText()).toEqual('nine-project app is running!');
13+
expect(page.getTitleText()).toEqual('ten-project app is running!');
1414
});
1515

1616
afterEach(async () => {
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"extends": "../tsconfig.json",
34
"compilerOptions": {
45
"outDir": "../out-tsc/e2e",
56
"module": "commonjs",
6-
"target": "es5",
7+
"target": "es2018",
78
"types": ["jasmine", "jasminewd2", "node"]
89
}
910
}

tests/legacy-cli/e2e/assets/9.0-project/karma.conf.js renamed to tests/legacy-cli/e2e/assets/10.0-project/karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function (config) {
1616
clearContext: false, // leave Jasmine Spec Runner output visible in browser
1717
},
1818
coverageIstanbulReporter: {
19-
dir: require('path').join(__dirname, './coverage/nine-project'),
19+
dir: require('path').join(__dirname, './coverage/ten-project'),
2020
reports: ['html', 'lcovonly', 'text-summary'],
2121
fixWebpackSourcePaths: true,
2222
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "ten-project",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"test": "ng test",
9+
"lint": "ng lint",
10+
"e2e": "ng e2e"
11+
},
12+
"private": true,
13+
"dependencies": {
14+
"@angular/animations": "~10.2.5",
15+
"@angular/common": "~10.2.5",
16+
"@angular/compiler": "~10.2.5",
17+
"@angular/core": "~10.2.5",
18+
"@angular/forms": "~10.2.5",
19+
"@angular/platform-browser": "~10.2.5",
20+
"@angular/platform-browser-dynamic": "~10.2.5",
21+
"@angular/router": "~10.2.5",
22+
"rxjs": "~6.6.0",
23+
"tslib": "^2.0.0",
24+
"zone.js": "~0.10.2"
25+
},
26+
"devDependencies": {
27+
"@angular-devkit/build-angular": "~0.1002.4",
28+
"@angular/cli": "~10.2.4",
29+
"@angular/compiler-cli": "~10.2.5",
30+
"@types/node": "^12.11.1",
31+
"@types/jasmine": "~3.5.0",
32+
"@types/jasminewd2": "~2.0.3",
33+
"codelyzer": "^6.0.0",
34+
"jasmine-core": "~3.6.0",
35+
"jasmine-spec-reporter": "~5.0.0",
36+
"karma": "~5.0.0",
37+
"karma-chrome-launcher": "~3.1.0",
38+
"karma-coverage-istanbul-reporter": "~3.0.2",
39+
"karma-jasmine": "~4.0.0",
40+
"karma-jasmine-html-reporter": "~1.5.0",
41+
"protractor": "~7.0.0",
42+
"ts-node": "~8.3.0",
43+
"tslint": "~6.1.0",
44+
"typescript": "~4.0.2"
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import { TestBed, async } from '@angular/core/testing';
1+
import { TestBed } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
44

55
describe('AppComponent', () => {
6-
beforeEach(async(() => {
7-
TestBed.configureTestingModule({
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
88
imports: [RouterTestingModule],
99
declarations: [AppComponent],
1010
}).compileComponents();
11-
}));
11+
});
1212

1313
it('should create the app', () => {
1414
const fixture = TestBed.createComponent(AppComponent);
1515
const app = fixture.componentInstance;
1616
expect(app).toBeTruthy();
1717
});
1818

19-
it(`should have as title 'nine-project'`, () => {
19+
it(`should have as title 'ten-project'`, () => {
2020
const fixture = TestBed.createComponent(AppComponent);
2121
const app = fixture.componentInstance;
22-
expect(app.title).toEqual('nine-project');
22+
expect(app.title).toEqual('ten-project');
2323
});
2424

2525
it('should render title', () => {
2626
const fixture = TestBed.createComponent(AppComponent);
2727
fixture.detectChanges();
2828
const compiled = fixture.nativeElement;
2929
expect(compiled.querySelector('.content span').textContent).toContain(
30-
'nine-project app is running!',
30+
'ten-project app is running!',
3131
);
3232
});
3333
});

tests/legacy-cli/e2e/assets/9.0-project/src/app/app.component.ts renamed to tests/legacy-cli/e2e/assets/10.0-project/src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import { Component } from '@angular/core';
66
styleUrls: ['./app.component.css'],
77
})
88
export class AppComponent {
9-
title = 'nine-project';
9+
title = 'ten-project';
1010
}

tests/legacy-cli/e2e/assets/9.0-project/src/index.html renamed to tests/legacy-cli/e2e/assets/10.0-project/src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>NineProject</title>
5+
<title>TenProject</title>
66
<base href="/">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="icon" type="image/x-icon" href="favicon.ico">

tests/legacy-cli/e2e/assets/9.0-project/src/polyfills.ts renamed to tests/legacy-cli/e2e/assets/10.0-project/src/polyfills.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
* BROWSER POLYFILLS
1919
*/
2020

21-
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
21+
/**
22+
* IE11 requires the following for NgClass support on SVG elements
23+
*/
2224
// import 'classlist.js'; // Run `npm install --save classlist.js`.
2325

2426
/**

tests/legacy-cli/e2e/assets/9.0-project/tsconfig.app.json renamed to tests/legacy-cli/e2e/assets/10.0-project/tsconfig.app.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"extends": "./tsconfig.json",
34
"compilerOptions": {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"compileOnSave": false,
34
"compilerOptions": {
@@ -7,14 +8,10 @@
78
"declaration": false,
89
"downlevelIteration": true,
910
"experimentalDecorators": true,
10-
"module": "esnext",
1111
"moduleResolution": "node",
1212
"importHelpers": true,
1313
"target": "es2015",
14+
"module": "es2020",
1415
"lib": ["es2018", "dom"]
15-
},
16-
"angularCompilerOptions": {
17-
"fullTemplateTypeCheck": true,
18-
"strictInjectionParameters": true
1916
}
2017
}

tests/legacy-cli/e2e/assets/9.0-project/tsconfig.spec.json renamed to tests/legacy-cli/e2e/assets/10.0-project/tsconfig.spec.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"extends": "./tsconfig.json",
34
"compilerOptions": {
45
"outDir": "./out-tsc/spec",
5-
"types": ["jasmine", "node"]
6+
"types": ["jasmine"]
67
},
78
"files": ["src/test.ts", "src/polyfills.ts"],
89
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]

0 commit comments

Comments
 (0)