Skip to content

Commit fbf6ec8

Browse files
filipesilvamatsko
authored andcommitted
test: update integration/cli-hello-world project structure (angular#33175)
PR Close angular#33175
1 parent 56731f6 commit fbf6ec8

27 files changed

+806
-350
lines changed

integration/_payload-limits.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"cli-hello-world": {
33
"master": {
44
"uncompressed": {
5-
"runtime": 1542,
6-
"main": 154385,
7-
"polyfills": 45541
5+
"runtime-es2015": 1485,
6+
"runtime-es5": 1485,
7+
"main-es2015": 141461,
8+
"main-es5": 163733,
9+
"polyfills-es2015": 36808,
10+
"polyfills-es5": 127675
811
}
912
}
1013
},

integration/cli-hello-world/.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
[*]
Lines changed: 46 additions & 0 deletions
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

integration/cli-hello-world/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CliHelloWorld
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 9.0.0-next.9.
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: 39 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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,
4-
"cli": {
5-
"packageManager": "yarn"
6-
},
74
"newProjectRoot": "projects",
85
"projects": {
96
"cli-hello-world": {
10-
"root": "",
117
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
1212
"architect": {
1313
"build": {
1414
"builder": "@angular-devkit/build-angular:browser",
@@ -17,50 +17,44 @@
1717
"index": "src/index.html",
1818
"main": "src/main.ts",
1919
"polyfills": "src/polyfills.ts",
20-
"tsConfig": "src/tsconfig.app.json",
20+
"tsConfig": "tsconfig.app.json",
21+
"aot": true,
2122
"assets": [
22-
{
23-
"glob": "assets",
24-
"input": "/src",
25-
"output": "/"
26-
},
27-
{
28-
"glob": "favicon.ico",
29-
"input": "/src",
30-
"output": "/"
31-
}
23+
"src/favicon.ico",
24+
"src/assets"
3225
],
3326
"styles": [
34-
{
35-
"input": "src/styles.css"
36-
}
27+
"src/styles.css"
3728
],
3829
"scripts": [],
3930
"progress": false
4031
},
4132
"configurations": {
42-
"dev": {
33+
"production": {
4334
"fileReplacements": [
4435
{
45-
"from": "src/environments/environment.ts",
46-
"to": "dist/environments/environment.ts"
36+
"replace": "src/environments/environment.ts",
37+
"with": "src/environments/environment.prod.ts"
4738
}
48-
]
49-
},
50-
"production": {
39+
],
5140
"optimization": true,
5241
"outputHashing": "all",
53-
"sourceMap": true,
42+
"sourceMap": false,
5443
"extractCss": true,
5544
"namedChunks": false,
56-
"aot": true,
5745
"extractLicenses": true,
5846
"vendorChunk": false,
5947
"buildOptimizer": true,
60-
"fileReplacements": [
48+
"budgets": [
49+
{
50+
"type": "initial",
51+
"maximumWarning": "2mb",
52+
"maximumError": "5mb"
53+
},
6154
{
62-
"src": "src/environments/environment.ts",
63-
"replaceWith": "src/environments/environment.prod.ts"
55+
"type": "anyComponentStyle",
56+
"maximumWarning": "6kb",
57+
"maximumError": "10kb"
6458
}
6559
]
6660
}
@@ -98,26 +92,16 @@
9892
"options": {
9993
"main": "src/test.ts",
10094
"polyfills": "src/polyfills.ts",
101-
"karmaConfig": "./karma.conf.js",
102-
"tsConfig": "src/tsconfig.spec.json",
103-
"scripts": [],
104-
"styles": [
105-
{
106-
"input": "src/styles.css"
107-
}
108-
],
95+
"tsConfig": "tsconfig.spec.json",
96+
"karmaConfig": "karma.conf.js",
10997
"assets": [
110-
{
111-
"glob": "assets",
112-
"input": "/src",
113-
"output": "/"
114-
},
115-
{
116-
"glob": "favicon.ico",
117-
"input": "/src",
118-
"output": "/"
119-
}
98+
"src/favicon.ico",
99+
"src/assets"
120100
],
101+
"styles": [
102+
"src/styles.css"
103+
],
104+
"scripts": [],
121105
"progress": false,
122106
"watch": false
123107
}
@@ -126,26 +110,19 @@
126110
"builder": "@angular-devkit/build-angular:tslint",
127111
"options": {
128112
"tsConfig": [
129-
"src/tsconfig.app.json",
130-
"src/tsconfig.spec.json"
113+
"tsconfig.app.json",
114+
"tsconfig.spec.json",
115+
"e2e/tsconfig.json"
131116
],
132117
"exclude": [
133118
"**/node_modules/**"
134119
]
135120
}
136-
}
137-
}
138-
},
139-
"cli-hello-world-e2e": {
140-
"root": "",
141-
"projectType": "application",
142-
"cli": {},
143-
"schematics": {},
144-
"architect": {
121+
},
145122
"e2e": {
146123
"builder": "@angular-devkit/build-angular:protractor",
147124
"options": {
148-
"protractorConfig": "./protractor.conf.js",
125+
"protractorConfig": "e2e/protractor.conf.js",
149126
"devServerTarget": "cli-hello-world:serve",
150127
"webdriverUpdate": false
151128
},
@@ -160,28 +137,8 @@
160137
"devServerTarget": "cli-hello-world:serve:ci-production"
161138
}
162139
}
163-
},
164-
"lint": {
165-
"builder": "@angular-devkit/build-angular:tslint",
166-
"options": {
167-
"tsConfig": [
168-
"e2e/tsconfig.e2e.json"
169-
],
170-
"exclude": [
171-
"**/node_modules/**"
172-
]
173-
}
174140
}
175141
}
176-
}
177-
},
178-
"schematics": {
179-
"@schematics/angular:component": {
180-
"prefix": "app",
181-
"styleext": "css"
182-
},
183-
"@schematics/angular:directive": {
184-
"prefix": "app"
185-
}
186-
}
142+
}},
143+
"defaultProject": "cli-hello-world"
187144
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

integration/cli-hello-world/e2e/app.e2e-spec.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

integration/cli-hello-world/e2e/app.po.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
// @ts-check
12
// Protractor configuration file, see link for more information
23
// https://github.com/angular/protractor/blob/master/lib/config.ts
34

45
const { SpecReporter } = require('jasmine-spec-reporter');
56

7+
/**
8+
* @type { import("protractor").Config }
9+
*/
610
exports.config = {
711
allScriptsTimeout: 11000,
812
specs: [
9-
'./e2e/**/*.e2e-spec.ts'
13+
'./src/**/*.e2e-spec.ts'
1014
],
1115
capabilities: {
12-
browserName: 'chrome',
13-
chromeOptions: {
14-
binary: process.env.CHROME_BIN,
15-
args: ['--no-sandbox']
16-
}
16+
'browserName': 'chrome'
1717
},
1818
directConnect: true,
1919
baseUrl: 'http://localhost:4200/',
@@ -25,8 +25,8 @@ exports.config = {
2525
},
2626
onPrepare() {
2727
require('ts-node').register({
28-
project: 'e2e/tsconfig.e2e.json'
28+
project: require('path').join(__dirname, './tsconfig.json')
2929
});
3030
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3131
}
32-
};
32+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('cli-hello-world app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

0 commit comments

Comments
 (0)