Skip to content

Commit 63748ab

Browse files
kyliauKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@schematics/angular): Add types to AppPage in e2e
When app.po.ts is compiled under Bazel with Typescript 3.2, AppPage produces the following error: e2e/src/app.po.ts:4:3 - error TS2742: The inferred type of 'navigateTo' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary. 4 navigateTo() { ~~~~~~~~~~ e2e/src/app.po.ts:8:3 - error TS2742: The inferred type of 'getTitleText' cannot be named without a reference to '../../external/npm/node_modules/@types/selenium-webdriver/index'. This is likely not portable. A type annotation is necessary. 8 getTitleText() { ~~~~~~~~~~~~
1 parent 04a7dca commit 63748ab

File tree

1 file changed

+2
-2
lines changed
  • packages/schematics/angular/e2e/files/src

1 file changed

+2
-2
lines changed

packages/schematics/angular/e2e/files/src/app.po.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { browser, by, element } from 'protractor';
22

33
export class AppPage {
44
navigateTo() {
5-
return browser.get('/');
5+
return browser.get('/') as Promise<any>;
66
}
77

88
getTitleText() {
9-
return element(by.css('<%= rootSelector %> h1')).getText();
9+
return element(by.css('<%= rootSelector %> h1')).getText() as Promise<string>;
1010
}
1111
}

0 commit comments

Comments
 (0)