Skip to content

Commit 62e45ce

Browse files
cexbrayatbenlesh
authored andcommitted
test: update cli-hello-world-ivy to [email protected] (angular#27797)
Updates the app itself to reflect the result of using the `experimentalIvy` flag on the CLI. The result is similar to: npx @angular/cli@next new cli-hello-world-ivy --experimental-ivy --defaults But replaces the current (cli `7.2.0-rc.0`) `renderComponent` bootstrap with the usual `platformBrowserDynamic` one. It also keeps what the app did (display a pipe, tests it). PR Close angular#27797
1 parent c34eee4 commit 62e45ce

23 files changed

Lines changed: 2445 additions & 2657 deletions

‎integration/cli-hello-world-ivy/.editorconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Editor configuration, see http://editorconfig.org
1+
# Editor configuration, see https://editorconfig.org
22
root = true
33

44
[*]

‎integration/cli-hello-world-ivy/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# CliHelloWorld
1+
# CliHelloWorldIvy
22

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

55
## Development server
66

@@ -12,7 +12,7 @@ Run `ng generate component component-name` to generate a new component. You can
1212

1313
## Build
1414

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
1616

1717
## Running unit tests
1818

Lines changed: 36 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
2-
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"cli": {
55
"packageManager": "yarn"
66
},
77
"newProjectRoot": "projects",
88
"projects": {
9-
"cli-hello-world": {
9+
"cli-hello-world-ivy": {
1010
"root": "",
11+
"sourceRoot": "src",
1112
"projectType": "application",
13+
"prefix": "app",
14+
"schematics": {},
1215
"architect": {
1316
"build": {
1417
"builder": "@angular-devkit/build-angular:browser",
@@ -19,47 +22,36 @@
1922
"polyfills": "src/polyfills.ts",
2023
"tsConfig": "src/tsconfig.app.json",
2124
"assets": [
22-
{
23-
"glob": "assets",
24-
"input": "/src",
25-
"output": "/"
26-
},
27-
{
28-
"glob": "favicon.ico",
29-
"input": "/src",
30-
"output": "/"
31-
}
25+
"src/favicon.ico",
26+
"src/assets"
3227
],
3328
"styles": [
34-
{
35-
"input": "src/styles.css"
36-
}
29+
"src/styles.css"
3730
],
3831
"scripts": []
3932
},
4033
"configurations": {
41-
"dev": {
34+
"production": {
4235
"fileReplacements": [
4336
{
44-
"from": "src/environments/environment.ts",
45-
"to": "dist/environments/environment.ts"
37+
"replace": "src/environments/environment.ts",
38+
"with": "src/environments/environment.prod.ts"
4639
}
47-
]
48-
},
49-
"production": {
40+
],
5041
"optimization": true,
5142
"outputHashing": "all",
52-
"sourceMap": true,
43+
"sourceMap": false,
5344
"extractCss": true,
5445
"namedChunks": false,
5546
"aot": true,
5647
"extractLicenses": true,
5748
"vendorChunk": false,
5849
"buildOptimizer": true,
59-
"fileReplacements": [
50+
"budgets": [
6051
{
61-
"src": "src/environments/environment.ts",
62-
"replaceWith": "src/environments/environment.prod.ts"
52+
"type": "initial",
53+
"maximumWarning": "2mb",
54+
"maximumError": "5mb"
6355
}
6456
]
6557
}
@@ -68,54 +60,41 @@
6860
"serve": {
6961
"builder": "@angular-devkit/build-angular:dev-server",
7062
"options": {
71-
"browserTarget": "cli-hello-world:build"
63+
"browserTarget": "cli-hello-world-ivy:build"
7264
},
7365
"configurations": {
74-
"dev": {
75-
"browserTarget": "cli-hello-world:build:dev"
76-
},
7766
"production": {
78-
"browserTarget": "cli-hello-world:build:production"
67+
"browserTarget": "cli-hello-world-ivy:build:production"
7968
},
8069
"ci": {
8170
"progress": false
8271
},
8372
"ci-production": {
84-
"browserTarget": "cli-hello-world:build:production",
73+
"browserTarget": "cli-hello-world-ivy:build:production",
8574
"progress": false
8675
}
8776
}
8877
},
8978
"extract-i18n": {
9079
"builder": "@angular-devkit/build-angular:extract-i18n",
9180
"options": {
92-
"browserTarget": "cli-hello-world:build"
81+
"browserTarget": "cli-hello-world-ivy:build"
9382
}
9483
},
9584
"test": {
9685
"builder": "@angular-devkit/build-angular:karma",
9786
"options": {
9887
"main": "src/test.ts",
9988
"polyfills": "src/polyfills.ts",
100-
"karmaConfig": "./karma.conf.js",
10189
"tsConfig": "src/tsconfig.spec.json",
102-
"scripts": [],
90+
"karmaConfig": "src/karma.conf.js",
10391
"styles": [
104-
{
105-
"input": "src/styles.css"
106-
}
92+
"src/styles.css"
10793
],
94+
"scripts": [],
10895
"assets": [
109-
{
110-
"glob": "assets",
111-
"input": "/src",
112-
"output": "/"
113-
},
114-
{
115-
"glob": "favicon.ico",
116-
"input": "/src",
117-
"output": "/"
118-
}
96+
"src/favicon.ico",
97+
"src/assets"
11998
]
12099
}
121100
},
@@ -133,36 +112,33 @@
133112
}
134113
}
135114
},
136-
"cli-hello-world-e2e": {
137-
"root": "",
115+
"cli-hello-world-ivy-e2e": {
116+
"root": "e2e/",
138117
"projectType": "application",
139-
"cli": {},
140-
"schematics": {},
118+
"prefix": "",
141119
"architect": {
142120
"e2e": {
143121
"builder": "@angular-devkit/build-angular:protractor",
144122
"options": {
145-
"protractorConfig": "./protractor.conf.js",
146-
"devServerTarget": "cli-hello-world:serve"
123+
"protractorConfig": "e2e/protractor.conf.js",
124+
"devServerTarget": "cli-hello-world-ivy:serve"
147125
},
148126
"configurations": {
149127
"production": {
150-
"devServerTarget": "cli-hello-world:serve:production"
128+
"devServerTarget": "cli-hello-world-ivy:serve:production"
151129
},
152130
"ci": {
153-
"devServerTarget": "cli-hello-world:serve:ci"
131+
"devServerTarget": "cli-hello-world-ivy:serve:ci"
154132
},
155133
"ci-production": {
156-
"devServerTarget": "cli-hello-world:serve:ci-production"
134+
"devServerTarget": "cli-hello-world-ivy:serve:ci-production"
157135
}
158136
}
159137
},
160138
"lint": {
161139
"builder": "@angular-devkit/build-angular:tslint",
162140
"options": {
163-
"tsConfig": [
164-
"e2e/tsconfig.e2e.json"
165-
],
141+
"tsConfig": "e2e/tsconfig.e2e.json",
166142
"exclude": [
167143
"**/node_modules/**"
168144
]
@@ -171,13 +147,5 @@
171147
}
172148
}
173149
},
174-
"schematics": {
175-
"@schematics/angular:component": {
176-
"prefix": "app",
177-
"styleext": "css"
178-
},
179-
"@schematics/angular:directive": {
180-
"prefix": "app"
181-
}
182-
}
150+
"defaultProject": "cli-hello-world-ivy"
183151
}

integration/cli-hello-world-ivy/protractor.conf.js renamed to integration/cli-hello-world-ivy/e2e/protractor.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter');
66
exports.config = {
77
allScriptsTimeout: 11000,
88
specs: [
9-
'./e2e/**/*.e2e-spec.ts'
9+
'./src/**/*.e2e-spec.ts'
1010
],
1111
capabilities: {
1212
browserName: 'chrome',
@@ -25,7 +25,7 @@ exports.config = {
2525
},
2626
onPrepare() {
2727
require('ts-node').register({
28-
project: 'e2e/tsconfig.e2e.json'
28+
project: require('path').join(__dirname, './tsconfig.e2e.json')
2929
});
3030
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3131
}

integration/cli-hello-world-ivy/e2e/app.e2e-spec.ts renamed to integration/cli-hello-world-ivy/e2e/src/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('cli-hello-world App', () => {
99

1010
it('should display welcome message', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('Welcome to app!');
12+
expect(page.getParagraphText()).toEqual('Welcome to cli-hello-world-ivy!');
1313
});
1414

1515
it('the percent pipe should work', () => {
File renamed without changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../out-tsc/e2e",
5-
"baseUrl": "./",
4+
"outDir": "../out-tsc/app",
65
"module": "commonjs",
76
"target": "es5",
87
"types": [
@@ -11,4 +10,4 @@
1110
"node"
1211
]
1312
}
14-
}
13+
}

‎integration/cli-hello-world-ivy/package.json‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "cli-hello-world",
2+
"name": "cli-hello-world-ivy",
33
"version": "0.0.0",
44
"license": "MIT",
55
"scripts": {
@@ -29,24 +29,24 @@
2929
"zone.js": "file:../../node_modules/zone.js"
3030
},
3131
"devDependencies": {
32-
"@angular-devkit/build-angular": "~0.10.3",
33-
"@angular/cli": "7.0.3",
32+
"@angular-devkit/build-angular": "~0.12.0-rc.0",
33+
"@angular/cli": "~7.2.0-rc.0",
3434
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
3535
"@angular/language-service": "file:../../dist/packages-dist/language-service",
36-
"@types/jasmine": "~2.8.3",
37-
"@types/jasminewd2": "~2.0.4",
38-
"@types/node": "~6.0.60",
39-
"codelyzer": "^4.3.0",
40-
"jasmine-core": "~2.8.0",
36+
"@types/node": "~8.9.4",
37+
"@types/jasmine": "~2.8.8",
38+
"@types/jasminewd2": "~2.0.3",
39+
"codelyzer": "~4.5.0",
40+
"jasmine-core": "~2.99.1",
4141
"jasmine-spec-reporter": "~4.2.1",
42-
"karma": "~2.0.0",
42+
"karma": "~3.1.1",
4343
"karma-chrome-launcher": "~2.2.0",
44-
"karma-coverage-istanbul-reporter": "^1.2.1",
45-
"karma-jasmine": "~1.1.0",
44+
"karma-coverage-istanbul-reporter": "~2.0.1",
45+
"karma-jasmine": "~1.1.2",
4646
"karma-jasmine-html-reporter": "^0.2.2",
4747
"protractor": "file:../../node_modules/protractor",
48-
"ts-node": "~4.1.0",
49-
"tslint": "~5.9.1",
48+
"ts-node": "~7.0.0",
49+
"tslint": "~5.11.0",
5050
"typescript": "file:../../node_modules/typescript"
5151
}
5252
}

‎integration/cli-hello-world-ivy/src/app/app.component.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h2>Here are some links to help you start: </h2>
1212
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
1313
</li>
1414
<li>
15-
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15+
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
1616
</li>
1717
<li>
1818
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { TestBed, async } from '@angular/core/testing';
22
import { AppComponent } from './app.component';
3+
34
describe('AppComponent', () => {
45
beforeEach(async(() => {
56
TestBed.configureTestingModule({
@@ -8,20 +9,23 @@ describe('AppComponent', () => {
89
],
910
}).compileComponents();
1011
}));
11-
it('should create the app', async(() => {
12+
13+
it('should create the app', () => {
1214
const fixture = TestBed.createComponent(AppComponent);
1315
const app = fixture.debugElement.componentInstance;
1416
expect(app).toBeTruthy();
15-
}));
16-
it(`should have as title 'app'`, async(() => {
17+
});
18+
19+
it(`should have as title 'cli-hello-world-ivy'`, () => {
1720
const fixture = TestBed.createComponent(AppComponent);
1821
const app = fixture.debugElement.componentInstance;
19-
expect(app.title).toEqual('app');
20-
}));
21-
it('should render title in a h1 tag', async(() => {
22+
expect(app.title).toEqual('cli-hello-world-ivy');
23+
});
24+
25+
it('should render title in a h1 tag', () => {
2226
const fixture = TestBed.createComponent(AppComponent);
2327
fixture.detectChanges();
2428
const compiled = fixture.debugElement.nativeElement;
25-
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
26-
}));
29+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to cli-hello-world-ivy!');
30+
});
2731
});

0 commit comments

Comments
 (0)