Skip to content

Commit

Permalink
test: update cli-hello-world-ivy to cli@7.2.0-rc.0 (angular#27797)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cexbrayat authored and ngfelixl committed Jan 27, 2019
1 parent 8403818 commit b51116f
Show file tree
Hide file tree
Showing 23 changed files with 2,445 additions and 2,657 deletions.
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy/.editorconfig
@@ -1,4 +1,4 @@
# Editor configuration, see http://editorconfig.org
# Editor configuration, see https://editorconfig.org
root = true

[*]
Expand Down
6 changes: 3 additions & 3 deletions integration/cli-hello-world-ivy/README.md
@@ -1,6 +1,6 @@
# CliHelloWorld
# CliHelloWorldIvy

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

## Development server

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

## Build

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.
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.

## Running unit tests

Expand Down
104 changes: 36 additions & 68 deletions integration/cli-hello-world-ivy/angular.json
@@ -1,14 +1,17 @@
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "yarn"
},
"newProjectRoot": "projects",
"projects": {
"cli-hello-world": {
"cli-hello-world-ivy": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
Expand All @@ -19,47 +22,36 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "assets",
"input": "/src",
"output": "/"
},
{
"glob": "favicon.ico",
"input": "/src",
"output": "/"
}
"src/favicon.ico",
"src/assets"
],
"styles": [
{
"input": "src/styles.css"
}
"src/styles.css"
],
"scripts": []
},
"configurations": {
"dev": {
"production": {
"fileReplacements": [
{
"from": "src/environments/environment.ts",
"to": "dist/environments/environment.ts"
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"production": {
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
"budgets": [
{
"src": "src/environments/environment.ts",
"replaceWith": "src/environments/environment.prod.ts"
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
Expand All @@ -68,54 +60,41 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "cli-hello-world:build"
"browserTarget": "cli-hello-world-ivy:build"
},
"configurations": {
"dev": {
"browserTarget": "cli-hello-world:build:dev"
},
"production": {
"browserTarget": "cli-hello-world:build:production"
"browserTarget": "cli-hello-world-ivy:build:production"
},
"ci": {
"progress": false
},
"ci-production": {
"browserTarget": "cli-hello-world:build:production",
"browserTarget": "cli-hello-world-ivy:build:production",
"progress": false
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "cli-hello-world:build"
"browserTarget": "cli-hello-world-ivy:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"karmaConfig": "./karma.conf.js",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"karmaConfig": "src/karma.conf.js",
"styles": [
{
"input": "src/styles.css"
}
"src/styles.css"
],
"scripts": [],
"assets": [
{
"glob": "assets",
"input": "/src",
"output": "/"
},
{
"glob": "favicon.ico",
"input": "/src",
"output": "/"
}
"src/favicon.ico",
"src/assets"
]
}
},
Expand All @@ -133,36 +112,33 @@
}
}
},
"cli-hello-world-e2e": {
"root": "",
"cli-hello-world-ivy-e2e": {
"root": "e2e/",
"projectType": "application",
"cli": {},
"schematics": {},
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "cli-hello-world:serve"
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "cli-hello-world-ivy:serve"
},
"configurations": {
"production": {
"devServerTarget": "cli-hello-world:serve:production"
"devServerTarget": "cli-hello-world-ivy:serve:production"
},
"ci": {
"devServerTarget": "cli-hello-world:serve:ci"
"devServerTarget": "cli-hello-world-ivy:serve:ci"
},
"ci-production": {
"devServerTarget": "cli-hello-world:serve:ci-production"
"devServerTarget": "cli-hello-world-ivy:serve:ci-production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
Expand All @@ -171,13 +147,5 @@
}
}
},
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
"defaultProject": "cli-hello-world-ivy"
}
Expand Up @@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
Expand All @@ -25,7 +25,7 @@ exports.config = {
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
Expand Down
Expand Up @@ -9,7 +9,7 @@ describe('cli-hello-world App', () => {

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

it('the percent pipe should work', () => {
Expand Down
5 changes: 2 additions & 3 deletions integration/cli-hello-world-ivy/e2e/tsconfig.e2e.json
@@ -1,8 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
Expand All @@ -11,4 +10,4 @@
"node"
]
}
}
}
26 changes: 13 additions & 13 deletions integration/cli-hello-world-ivy/package.json
@@ -1,5 +1,5 @@
{
"name": "cli-hello-world",
"name": "cli-hello-world-ivy",
"version": "0.0.0",
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -29,24 +29,24 @@
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.3",
"@angular/cli": "7.0.3",
"@angular-devkit/build-angular": "~0.12.0-rc.0",
"@angular/cli": "~7.2.0-rc.0",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@angular/language-service": "file:../../dist/packages-dist/language-service",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.4",
"@types/node": "~6.0.60",
"codelyzer": "^4.3.0",
"jasmine-core": "~2.8.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "file:../../node_modules/protractor",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "file:../../node_modules/typescript"
}
}
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy/src/app/app.component.html
Expand Up @@ -12,7 +12,7 @@ <h2>Here are some links to help you start: </h2>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
Expand Down
20 changes: 12 additions & 8 deletions integration/cli-hello-world-ivy/src/app/app.component.spec.ts
@@ -1,5 +1,6 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
Expand All @@ -8,20 +9,23 @@ describe('AppComponent', () => {
],
}).compileComponents();
}));
it('should create the app', async(() => {

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
});

it(`should have as title 'cli-hello-world-ivy'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
expect(app.title).toEqual('cli-hello-world-ivy');
});

it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
expect(compiled.querySelector('h1').textContent).toContain('Welcome to cli-hello-world-ivy!');
});
});
2 changes: 1 addition & 1 deletion integration/cli-hello-world-ivy/src/app/app.component.ts
Expand Up @@ -6,5 +6,5 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
title = 'cli-hello-world-ivy';
}
11 changes: 11 additions & 0 deletions integration/cli-hello-world-ivy/src/browserslist
@@ -0,0 +1,11 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11

0 comments on commit b51116f

Please sign in to comment.