Skip to content

Commit 4dcbf38

Browse files
committed
test: fix e2e tests with latest devkit
1 parent af5bd52 commit 4dcbf38

File tree

12 files changed

+99
-86
lines changed

12 files changed

+99
-86
lines changed

package-lock.json

Lines changed: 17 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
},
4242
"homepage": "https://github.com/angular/angular-cli",
4343
"dependencies": {
44-
"@angular-devkit/architect": "angular/angular-devkit-architect-builds#779e8fc",
45-
"@angular-devkit/core": "angular/angular-devkit-core-builds#779e8fc",
46-
"@angular-devkit/schematics": "angular/angular-devkit-schematics-builds#779e8fc",
47-
"@schematics/angular": "angular/schematics-angular-builds#779e8fc",
48-
"@schematics/update": "angular/schematics-update-builds#779e8fc",
44+
"@angular-devkit/architect": "angular/angular-devkit-architect-builds#c11c6ca",
45+
"@angular-devkit/core": "angular/angular-devkit-core-builds#c11c6ca",
46+
"@angular-devkit/schematics": "angular/angular-devkit-schematics-builds#c11c6ca",
47+
"@schematics/angular": "angular/schematics-angular-builds#c11c6ca",
48+
"@schematics/update": "angular/schematics-update-builds#c11c6ca",
4949
"ajv": "^6.1.1",
5050
"chalk": "~2.2.0",
5151
"common-tags": "^1.3.1",
@@ -56,9 +56,10 @@
5656
"node-modules-path": "^1.0.0",
5757
"opn": "~5.1.0",
5858
"resolve": "^1.1.7",
59-
"rxjs": "^5.5.8",
59+
"rxjs": "^6.0.0-rc.0",
6060
"semver": "^5.3.0",
6161
"silent-error": "^1.0.0",
62+
"symbol-observable": "^1.2.0",
6263
"yargs-parser": "^9.0.2"
6364
},
6465
"devDependencies": {

packages/@angular/cli/models/architect-command.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { experimental } from '@angular-devkit/core';
22
import { NodeJsSyncHost, createConsoleLogger } from '@angular-devkit/core/node';
3-
import { Architect, TargetSpecifier } from '@angular-devkit/architect';
3+
import {
4+
Architect, BuilderDescription, BuildEvent,
5+
TargetSpecifier
6+
} from '@angular-devkit/architect';
47
import { Command, Option } from './command';
5-
import { from } from 'rxjs/observable/from';
8+
import { of } from 'rxjs';
9+
import { from } from 'rxjs';
610
import { concatMap, map, tap, toArray } from 'rxjs/operators';
711
import { WorkspaceLoader } from '../models/workspace-loader';
8-
import { of } from 'rxjs/observable/of';
912
const stringUtils = require('ember-cli-string-utils');
1013

1114

@@ -31,7 +34,7 @@ export abstract class ArchitectCommand extends Command {
3134

3235
target: string | undefined;
3336

34-
public async initialize(options: any) {
37+
public async initialize(options: any): Promise<void> {
3538
return this._loadWorkspaceAndArchitect().pipe(
3639
concatMap(() => {
3740
let targetSpec: TargetSpecifier;
@@ -64,10 +67,11 @@ export abstract class ArchitectCommand extends Command {
6467
const builderConfig = this._architect.getBuilderConfiguration(targetSpec);
6568

6669
return this._architect.getBuilderDescription(builderConfig).pipe(
67-
tap((builderDesc) => this.mapArchitectOptions(builderDesc.schema))
70+
tap<BuilderDescription>(builderDesc => { this.mapArchitectOptions(builderDesc.schema); })
6871
);
6972
})
70-
).toPromise();
73+
).toPromise()
74+
.then(() => {});
7175
}
7276

7377
public validate(options: any) {
@@ -148,9 +152,10 @@ export abstract class ArchitectCommand extends Command {
148152

149153
protected async runArchitectTarget(targetSpec: TargetSpecifier): Promise<number> {
150154
const runSingleTarget = (targetSpec: TargetSpecifier) => this._architect.run(
151-
this._architect.getBuilderConfiguration(targetSpec), { logger: this._logger }
155+
this._architect.getBuilderConfiguration(targetSpec),
156+
{ logger: this._logger }
152157
).pipe(
153-
map(buildEvent => buildEvent.success ? 0 : 1)
158+
map((buildEvent: BuildEvent) => buildEvent.success ? 0 : 1)
154159
);
155160

156161
if (!targetSpec.project && this.target) {
@@ -174,9 +179,11 @@ export abstract class ArchitectCommand extends Command {
174179
const workspaceLoader = new WorkspaceLoader(this._host);
175180

176181
return workspaceLoader.loadWorkspace().pipe(
177-
tap(workspace => this._workspace = workspace),
178-
concatMap(workspace => new Architect(workspace).loadArchitect()),
179-
tap(architect => this._architect = architect),
182+
tap((workspace: experimental.workspace.Workspace) => this._workspace = workspace),
183+
concatMap((workspace: experimental.workspace.Workspace) => {
184+
return new Architect(workspace).loadArchitect();
185+
}),
186+
tap((architect: Architect) => this._architect = architect),
180187
);
181188
}
182189
}

packages/@angular/cli/models/schematic-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export abstract class SchematicCommand extends Command {
300300
const workspaceLoader = new WorkspaceLoader(this._host);
301301

302302
workspaceLoader.loadWorkspace().pipe(take(1))
303-
.subscribe(workspace => this._workspace = workspace);
303+
.subscribe((workspace: experimental.workspace.Workspace) => this._workspace = workspace);
304304
}
305305

306306
private readDefaults(collectionName: string, schematicName: string, options: any): any {

packages/@angular/cli/models/workspace-loader.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77
normalize,
88
virtualFs
99
} from '@angular-devkit/core';
10-
import { Observable } from 'rxjs/Observable';
11-
import { of } from 'rxjs/observable/of';
10+
import { Observable, of } from 'rxjs';
1211
import { concatMap, tap } from 'rxjs/operators';
1312
import * as fs from 'fs';
1413
import { homedir } from 'os';

packages/@angular/cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@
4242
"node-modules-path": "^1.0.0",
4343
"opn": "~5.1.0",
4444
"resolve": "^1.1.7",
45-
"rxjs": "^5.5.8",
45+
"rxjs": "^6.0.0-rc.0",
4646
"semver": "^5.1.0",
4747
"silent-error": "^1.0.0",
48+
"symbol-observable": "^1.2.0",
4849
"yargs-parser": "^9.0.2"
4950
},
5051
"ng-update": {

tests/e2e/tests/basic/scripts-array.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export default function () {
4040
{ input: 'src/cstring-script.js' },
4141
{ input: 'src/input-script.js' },
4242
{ input: 'src/lazy-script.js', lazy: true },
43-
{ input: 'src/pre-rename-script.js', output: 'renamed-script' },
44-
{ input: 'src/pre-rename-lazy-script.js', output: 'renamed-lazy-script', lazy: true }
43+
{ input: 'src/pre-rename-script.js', bundleName: 'renamed-script' },
44+
{ input: 'src/pre-rename-lazy-script.js', bundleName: 'renamed-lazy-script', lazy: true }
4545
];
4646
}))
4747
.then(() => ng('build', '--extract-css'))

tests/e2e/tests/basic/styles-array.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default function () {
2222
{ input: 'src/string-style.css' },
2323
{ input: 'src/input-style.css' },
2424
{ input: 'src/lazy-style.css', lazy: true },
25-
{ input: 'src/pre-rename-style.css', output: 'renamed-style' },
26-
{ input: 'src/pre-rename-lazy-style.css', output: 'renamed-lazy-style', lazy: true }
25+
{ input: 'src/pre-rename-style.css', bundleName: 'renamed-style' },
26+
{ input: 'src/pre-rename-lazy-style.css', bundleName: 'renamed-lazy-style', lazy: true }
2727
];
2828
}))
2929
.then(() => ng('build', '--extract-css'))
@@ -32,7 +32,10 @@ export default function () {
3232
.then(() => expectFileToMatch('dist/test-project/styles.css', '.input-style'))
3333
.then(() => expectFileToMatch('dist/test-project/lazy-style.css', '.lazy-style'))
3434
.then(() => expectFileToMatch('dist/test-project/renamed-style.css', '.pre-rename-style'))
35-
.then(() => expectFileToMatch('dist/test-project/renamed-lazy-style.css', '.pre-rename-lazy-style'))
35+
.then(() => expectFileToMatch(
36+
'dist/test-project/renamed-lazy-style.css',
37+
'.pre-rename-lazy-style',
38+
))
3639
// index.html lists the right bundles
3740
.then(() => expectFileToMatch('dist/test-project/index.html', oneLineTrim`
3841
<link rel="stylesheet" href="styles.css">

tests/e2e/tests/build/environment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default function() {
1111
appArchitect.build.configurations['prod-env'] = {
1212
fileReplacements: [
1313
{
14-
from: 'src/environments/environment.ts',
15-
to: 'src/environments/environment.prod.ts'
14+
src: 'src/environments/environment.ts',
15+
replaceWith: 'src/environments/environment.prod.ts'
1616
}
1717
],
1818
};

tests/e2e/tests/build/platform-server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ export default function () {
4242
options: {
4343
outputPath: 'dist/test-project-server',
4444
main: 'src/main.server.ts',
45-
tsConfig: 'tsconfig.server.json'
45+
tsConfig: 'src/tsconfig.server.json'
4646
}
4747
};
4848
}))
49-
.then(() => writeFile('./tsconfig.server.json', `
49+
.then(() => writeFile('./src/tsconfig.server.json', `
5050
{
51-
"extends": "../../tsconfig.json",
51+
"extends": "../tsconfig.json",
5252
"compilerOptions": {
5353
"outDir": "../dist-server",
5454
"baseUrl": "./",
@@ -60,7 +60,7 @@ export default function () {
6060
"**/*.spec.ts"
6161
],
6262
"angularCompilerOptions": {
63-
"entryModule": "src/app/app.server.module#AppServerModule"
63+
"entryModule": "app/app.server.module#AppServerModule"
6464
}
6565
}
6666
`))

0 commit comments

Comments
 (0)